Multiple PDF files for one submission?

DHMG

New Member
Hello Community,

anyone got an idea how I could create a second PDF file on form submission? I need an invoice and a filled in SEPA-mandate.

The first gets created with submission through the custom pdf-template, but how can I add a second PDF file to the e-mailed files?

Anyone got an idea?
 
There's no built in way. I can't even think of a way of doing it with the email plugin. You'd probably have to write a complete custom submission plugin.

-- hugh
 
Thanks for the reply hugh - would something like this possibly work in a fabrik-php environment?

PHP:
require('fpdf.php'); //install FPDF library and load it here
$pdf=new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times','',12);
for($i=1;$i<=40;$i++)
    $pdf->Cell(0,10,'Current line number '.$i,0,1);
$pdf->Output('example_001.pdf', 'I');
That would at least create the PDF file - mailing it should be possible if i enter the file path & name to attachment section in the mail plugin
 
Last edited:
If you have FPDF installed, it should.

Although you could also use the existing PDF class we use ...

Code:
$pdf = Pdf::renderPdf($html, 'A4', 'portrait');
JFile::write(JFactory::getConfig()->get('tmp_path') . '/yourfile.php', $pdf);

... where $html if valid markup for an HTML document. And the second two are the various size and orientation options we allow.

That function will use whichever PDF lib you have selected in the Fabrik global options (DOMPDF or MPDF).

-- hugh
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top