Forums

Send the form as a PDF

Fritz 09 Aug, 2009
Would it be possible to send the form as a PDF? With the input informations from the visitor, create a single PDF file with a background graphic?
GreyHead 09 Aug, 2009
Hi Fritz,

The simple answer is 'No', Joomla PDF support is poor.

The complicated answer is 'Yes, maybe'. I've had some success with Jan's PhocaPDF which has much better control. But it doesn't work directly with ChronoForms. I saved my form output into a Joomla article and was able to use PhocaPDF from there OK.

I'm sure it' spossible to link PhocaPDF to ChronoForms more directly but it hasn't been done as far as I know.

Bob
nml375 09 Aug, 2009
Hi,
Possibly yes, trivial I'd say no.

First thought that comes to mind, would be to use the JDocumentPDF class to create a new dynamic document and render it to a pdf-file. The rough outline of how you'd do this, would be something like this I suppose:
<? $pdf = JFactory::getDocument('pdf');
$pdf->setBuffer('Hello World!');
$content = $pdf->render();
?>


Next step though, would be to do something sensible with the generated data. One way might be to write this to a temporary file and provide a download-link to the user, I suppose. Also, I'm not sure how competent the JDocumentPDF class (built upon TCPDF), such as if it is capable of rendering background graphics or such. There are also other pdf libraries you could use, although I cannot recommend any specific one.

Edit: See you beat me to it, Bob🙂

/Fredrik
Fritz 10 Aug, 2009
Thank you very much of the information. Mine is an idea born from the requests of some customers who are evaluating joomla as a new web platform. I was therefore looking for a solution looking for among the various modules.
This topic is locked and no more replies can be posted.