FreePgs.com Forum

FreePgs Related => Support Requests => Topic started by: grapesmoker on April 27, 2006, 03:58:05 PM

Title: PDF generation
Post by: grapesmoker on April 27, 2006, 03:58:05 PM
I'm interested in dynamically generating some PDF files from information stored in a database. The naive way to do it is to use exec(), which is obviously not allowed. Is there another way to accomplish this? Thanks in advance to anyone who can suggest a workaround.
Title: Re: PDF generation
Post by: Guide on April 27, 2006, 07:46:11 PM
There is a free PHP class through which PDF files can be generated on the fly through PHP :
www.fpdf.org (http://www.fpdf.org)
It isn't too hard to use, and the tutorials are quite clear.

Example of use : (from their first tutorial)


<?php
require('fpdf.php');

$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>