PDF generation

i need to gather data from database and has to generate it into a PDF has anyone has idea about it

To get the data out of your DB you need to use your models. The tricky part is the PDF.

I’d try to use something like this: http://www.fpdf.org/ as a 3rd party library ( here is a how-to for implementing other libraries: http://www.yiiframework.com/doc/guide/extension.integration )


I was about to ask the same question.

Tsc. FPDF requires too much effort. I have googled so much, but in PHP there isn´t nothing like iReport in Java.

Actually, I am even designing my report on iReport, and using php_java_bridge to interconnect php and Java. I spent some work to make the bridge works, but now I am designing and making my PDFs very quickly! :)

  • ps: by the way, it would be so much easier if PHP have some sort of PDF design like iReport =(

I don’t think FPDF would be so much “effort” that would make me create a bridge to a Java lib (jar!?). (but I’m not familiar with iReport … or Java :) )

Even though, FPDF always did the job for me (so far) there are other libraries available: TCPDF - http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf or Zend_pdf - http://framework.zend.com/manual/en/zend.pdf.html


iReport allows you to use a “Drag and Drop” designer for your PDFs. That’s why I preferred to use it.

I will see the other libs you have posted and after I will comment about them.

PDF seems to be a complex format.

Last time I checked Zend_Pdf didn’t allow for text alignment but supported unicode. FPDF do allow some sort of text aligment, but doesn’t handle unicode well. If you are going fancy with PHP <-> PDF you should really consider PDFlib.

We use Lithron (a CSS2 compatible PDF-renderer on top of PDFlib) on Stay.com which basically let you work with your PDF documents as XML and style them with CSS. Lithron is BSD licensed, while you have to buy a license for PDFlib in order to remove the watermark which comes on rendered pages with the free version.

All libraries named here is sucks.

I now only one with normal generator its (htmldoc.org).

Of course if no have a some licence for none opensource libs.

you can always go back to the basics with LaTeX (http://www.latex-project.org/) and create the best PDF there is ;)


No thanks. Create PDF over Postscript is not for me. i close this way some projects ago.

But if very verY veRY vERY VERY VERY! want use this way: virtual printer better then latex and etc.