TOPIC:

PDF Attachment File name 4 years 3 months ago #222084

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

no need to apologize. Feel free to ask anything you want to know.

Disregard my previous post.

To add a footer to the end of the pdf attachment please follow this steps:

1) Go to joomla\administrator\components\com_breezingforms\libraries\tcpdf folder and open the tcpdf.php file.
At the end of the file, after
// END OF TCPDF CLASS
add this code:
class MYPDF extends TCPDF {

	// Page footer
	public function Footer() {
		
		// Set font
		$this->SetFont('helvetica', 'I', 8);
		// Page number
		$this->writeHTMLCell(0, 10, 22, 280,'<div class="footer">
    This is a footer text
</div>');
	}
}

2) Go to joomla\components\com_breezingforms and edit the file facileforms.process.php in the following ways:

a) Replace the following code code around line 5079
$pdf = new TCPDF();
with this:
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

b) Around line 5126 after the line
$pdf->setPrintHeader(false);
add this line of code:
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);

That should do the trick. This code will add footer to all the pdf attachments.

In the public function Footer() function in the first piece of code that I've sent you replace This is a footer text with the text that you want to have in the footer.

Let me know if you managed to set this for your attachments and if you have more questions, feel free to ask.

Regards,

Mihaela

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

PDF Attachment File name 4 years 3 months ago #222189

  • Topic Author
  • nigel
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 163
  • Thanks: 1
Will I have to update these files every time there is an update for Breezing Forms?

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

PDF Attachment File name 4 years 3 months ago #222256

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 416
Yes you will because when updating Breezing Forms those files get updated as well.

Regards,

Mihaela

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

PDF Attachment File name 4 months 1 week ago #267949

  • sitavs
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 22
  • Thanks: 0
If anyone else comes across this thread and needs to add a footer (like I did!) I found the quicker way was to edit the pdf_attachment.php in media/breezingforms/pdfpl folder.

I simply added:
	<tr>
	<td colspan="2" bgcolor="#cccccc" align="left" valign="middle">
		<?php echo '<img src="'.JPATH_SITE.'/media/breezingforms/uploads/bls_footer.jpg'.'" />' ?>
	</td>
before the final </tr></table> to include an image as the footer. Clearly, this could be text, if you'd prefer.

As per other threads, I renamed the the file to MyFormName_pdf_attachment.php, (using the name of the form where I want the footer included instead of MyFormName)

Hope this is of some help to someone.

Simon

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

PDF Attachment File name 4 months 1 week ago #267950

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 10179
  • Karma: 3
  • Thanks: 683
Hi,

thank you for sharing this :)

Regards,
Tihana

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

PDF Attachment File name 4 months 2 days ago #268526

  • CaroZumi
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 7
  • Thanks: 0

mihaela wrote: 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


Hallo
Vielen Dank, hat wunderbar geklappt.
Kann ich den gleichen Code auch für meine anderen Formulare benutzen? Einfach komplett den gleichen Code nochmals hinein kopieren und den Namen wieder austauschen oder nur der erste Teil?

Die Linie hat sich etwas verändert: 5380

Vielen Dank.

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

Last edit: Post by CaroZumi.
Moderators: ForumSupport
Time to create page: 0.043 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

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

Summer 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!