CREATION OF A PDF FILE

  • Posts: 10
  • Thank you received: 0

snappysites replied the topic: CREATION OF A PDF FILE

Hi, Mihaela

Thanks for your help so far.
The package is attached.

I couldn't find my custom scripts and pieces listed in the package generator "scripts" and "pieces" select lists, so here they are:

Submitted Script

function ff_mandategenerator_submitted(status, message){if(status==0){ff_switchpage(2);}else{alert(message);}}


Form Pieces
After

if( JRequest::getInt( 'ff_status', -1 ) == 0 ){
echo '<script type="text/javascript">
<!--
document.getElementById("pdf_download").innerHTML = \'<a href="'.JURI::root(true).'/components/com_breezingforms/exports/'.basename(JFactory::getSession()->get('breezingforms.pdf.download', '')).'">DOWNLOAD PDF</a>\';
//->
</script>';
}


Submit Pieces
End Submit

global $ff_compath;

$file = JPATH_SITE . '/administrator/components/com_breezingforms/pdftpl/' . $this->formrow->name . '_pdf_attachment.php';
if (!JFile::exists($file)) {
$file = JPATH_SITE . '/administrator/components/com_breezingforms/pdftpl/pdf_attachment.php';
}

$processed = array();
$xmldata = array();

$_xmldata = $this->xmldata;

foreach ($_xmldata as $data) {
$xmldata[] = $data;
}

ob_start();
require($file);
$c = ob_get_contents();
ob_end_clean();

require_once(JPATH_SITE . '/administrator/components/com_breezingforms/libraries/tcpdf/tcpdf.php');
$pdf = new TCPDF();
$pdf->setPrintHeader(false);
$pdf->AddPage();
$pdf->writeHTML($c);
mt_srand();
$pdfname = $ff_compath . '/exports/download-pdf-' . date('YmdHis') . '-' . mt_rand(0, mt_getrandmax()) . '.pdf';
$pdf->lastPage();
$pdf->Output($pdfname, "F");

JFactory::getSession()->set('breezingforms.pdf.download', $pdfname);


File Attachment:

File Name: mandategen....xml.zip
File Size:28 KB
#233771
Attachments:
  • Posts: 2109
  • Karma: 72
  • Thank you received: 268

mihaela replied the topic: CREATION OF A PDF FILE

Hello,

The scripts put in form's Advanced settings (Form pieces/Scripts/Submit pieces) are automatically saved with the form, just so you know for the next time.

As for your email template, I can't find the error in it, but when I've tried to recreate the template it is working.

I'm sending you an example attached so you can test it.

You can try to rebuild the template based on that file as i can't see where the error is in the other file.

Let me know whether you've managed to do so.

Regards,

Mihaela
#233808
Attachments:
  • Posts: 10
  • Thank you received: 0

snappysites replied the topic: CREATION OF A PDF FILE

hmmm, that's strange.

Is it possible that it could have anything to do with my server's configuration?
I've attached the Joomla System Information text file

File Attachment:

File Name: systeminfo....txt.zip
File Size:13 KB
#233834
Attachments:
  • Posts: 2109
  • Karma: 72
  • Thank you received: 268

mihaela replied the topic: CREATION OF A PDF FILE

Hello,

I assume that it is not due to your server settings since I get the same behavior on my local site. Something is wrong with the template file. When I've tried to use mine example file(which I've sent) it is working fine.

Furthermore, I see that you have set-up your form to have a link to download pdf at the "Thank you page". From the code in End Submit pieces I see that it will always print out the default pdf.

If you wish that here also the Custom pdf template is displayed please go to form's Advanced properties > More options > Submit pieces and in the End Submit section replace this line of code:
$file = JPATH_SITE . '/administrator/components/com_breezingforms/pdftpl/' . $this->formrow->name . '_pdf_attachment.php';
with this one:
$file = JPATH_SITE . '/media/breezingforms/pdftpl/' . $this->formrow->name . '_pdf_attachment.php';

Let me know whether you've managed to set this for your form and make it work using the email template I've provided.

Regards,

Mihaela
#233853
  • Posts: 10
  • Thank you received: 0

snappysites replied the topic: CREATION OF A PDF FILE

Hi, Mihaela

Thank you for all your assistance.
I took your advice and created a new form.
The PDF is working fine, now.
#233928
  • Posts: 2109
  • Karma: 72
  • Thank you received: 268

mihaela replied the topic: CREATION OF A PDF FILE

Hello again,

Great! I'm glad that it is working fine now.

Best regards,

Mihaela
#233936
The following user(s) said Thank You: snappysites
Moderators: ForumSupporttomeperica
Time to create page: 0.082 seconds

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99€

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here