• Increase font size
  • Default font size
  • Decrease font size

how to generate pdf in joomla

Joomla is capable to convert html code into pdf document. Here is the code which may be used in your new joomla components:

 

 
//variable with a html code you want to convert into PDF file
$html = "test of the <b>PDF</b> file generator";
 
$pdf = new JDocumentPDF();
$pdf->setTitle($title);
$pdf->setName($name);
$pdf->setDescription("CV automaticaly generated at http://strongcv.com");
$pdf->setMetaData('keywords', "free CV builder");
$pdf->setBuffer($html);
$data = $pdf->render();
 
//Output new PDF file
header('Content-type: application/pdf');
header("Content-Disposition: attachment; filename={$_POST[filename]}");
echo $data;
 

 

Add comment

No bad words.


Security code
Refresh


New articles

Contact programming-other
Read More 100 Hits
Rasco Resizer - documentation programming-other
Read More 93 Hits
Programming partners programming-other
Read More 205 Hits
Read More 436 Hits

Most read content

New articles

Contact programming-other
Read More 100 Hits
Rasco Resizer - documentation programming-other
Read More 93 Hits
Programming partners programming-other
Read More 205 Hits
Read More 436 Hits
Design by i-cons.ch / etosha-namibia.ch