TOPIC:

PDF Attachment File name 4 years 9 months ago #221957

  • Topic Author
  • nigel
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 163
  • Thanks: 1
I want to change the name of the PDF attachment, so it is more in keeping with my company, something like "A PFY document" rather than the "ffexport-pdf-20180208174412-606695767.pdf"

Is this possible and if so how can I do it?

Also I want to center an image in a customised PDF attachment.php , I have tried all sors but getting nowhere

thanks

Nigel

Please Log in or Create an account to join the conversation.

PDF Attachment File name 4 years 9 months ago #221984

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 416
Hello,

You can change the name of the pdf attachment if you follow this steps.

Go to \components\com_breezingforms\ and open the file facileforms.process.php.

Around line 5129 you have to replace this code:
$pdfname = $this->uploads . '/ffexport-pdf-' . $date_stamp . '-' . mt_rand(0, mt_getrandmax()) . '.pdf';
with this one:
$yourname="A PFY document";
if($this->formrow->name=='formname'){

                    $pdfname = $ff_compath . '/exports/'.$yourname.'.pdf';
                    }
                    else{
                $pdfname = $ff_compath . '/exports/ffexport-pdf-' . $date_stamp . '-' . mt_rand(0, mt_getrandmax()) . '.pdf';
            }
NOTE: In the code that I have sent you replace formname with the Name of your form, not Title.
Save the changes you've made and that should do the trick.

If needed, you can also include fields from your form in the PDF-attachment name. Regarding that, you can take a look here crosstec.org/en/forums/41-breezingforms-...-dropbox.html#194250 .

Let me know if that helped.

Regarding your second question, could you please tell me how are you trying to center it. You can send me the template of the pdf as an attachment.

Regrads,

Mihaela
The following user(s) said Thank You: CaroZumi

Please Log in or Create an account to join the conversation.

PDF Attachment File name 4 years 9 months ago #221988

  • Topic Author
  • nigel
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 163
  • Thanks: 1
Thanks for that I have now sorted the centering of the image, I am new to all this.

Another question, is it possible to put a footer on the bottom of each generated page of the pdf?

Thanks

nigel

Please Log in or Create an account to join the conversation.

PDF Attachment File name 4 years 9 months ago #221990

  • Topic Author
  • nigel
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 163
  • Thanks: 1
Yet another question, is it possible to name each different form, so if I was filling out a form called Contract 1, the exported pdf would have that form name, and if I filled out Contract 2 the pdf would be called that?

Please Log in or Create an account to join the conversation.

PDF Attachment File name 4 years 9 months ago #221994

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 416
Hello,

The answer to the second question is yes, it possible to name each different form, the pdf exports can be named differently.

You would just have to add more if statements to the code I've sent before. The code would look something like this:
if($this->formrow->name=='form1'){
                    $yourname="Contract 1,";
                    $pdfname = $ff_compath . '/exports/'.$yourname.'.pdf';
                    }
else if($this->formrow->name=='form2'){
                    $yourname="Contract 2,";
                    $pdfname = $ff_compath . '/exports/'.$yourname.'.pdf';
                    }
                    else{
                $pdfname = $ff_compath . '/exports/ffexport-pdf-' . $date_stamp . '-' . mt_rand(0, mt_getrandmax()) . '.pdf';
            }
This is an example code if two forms were Named form1 and form2 their Titles were Contract1 and Contract2.
You have to replace the form1 and form2 with the Names of the forms.

Regarding the question about the footer, you can add a code like this:
<!-- Your footer -->
<div width="100%">
<p align="right">################This is your Footer#############</p>
<p align="right">Your Text Here</p>
</div>

Let me know if you have more questions.

Regards,

Mihaela

Please Log in or Create an account to join the conversation.

PDF Attachment File name 4 years 9 months ago #222011

  • Topic Author
  • nigel
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 163
  • Thanks: 1
Sorry to sound stupid, but in which file and where do I insert the footer code

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.054 seconds

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!