PDF with PHP

Today, my friend ask me “I have a error in my webserver. It’s OK in localhost. It doesn’t show error when I uploaded. Can you check for me ?” I check his code and he is using PDFLib and written by PHP 4. I ask hime “What version of PHP use in your web server ? It’s using PHP 5.Oh! That is a problem because your are written by PDFLib PHP 4 version. You should change to version 5.”

“Oh! PDFLib is not free.Free for personal and not for comerical.” So I adivce him to use ဿFPDF. I love FPDF because we can use include function and we call it. If you use PDFLib, you should add .dll or lib in php.ini. So, I use FPDF. You can download package and it also include tutorial in tutorial folder.

Same Code are here [sourcecode lang=”php”] <?php require(‘../fpdf.php’);

$pdf=new FPDF(); $pdf->AddPage(); $pdf->SetFont(‘Arial’,’B’,16); $pdf->Cell(40,10,’Hello World!’); $pdf->Cell(40,20,’TESTING’); $pdf->Output(); ?> [/sourcecode]

comments powered byDisqus