hi all, Which is th best pdf generator for php, i know some opensources libs mpdf and fpdf.. Thanx in advance
I personally generate XSL:FO from PHP and use Apache FOP to convert it to PDF. Not a PHP-native solution, not very efficient either, but it works well even if you need to generate PDF with very complex layouts.
Personally I prefer to use [http://www.digitaljunkies.ca/dompdf/ dompdf] for simple PDF pages as it is very quick. you simply feed it an HTML source and it will generate the required page.
however for more complex designs i prefer the more classic [http://www.pdflib.com/ pdflib] which is available as a pecl for PHP. it has greater control over designs and allows you do do more complex designs like pixel-perfect forms.
The Zend Framework's Zend_Pdf is really good too. It's on par with pdflib in terms of control of output and complexity and is more portable because its a pure php solution. That said, its slower and uses more memory than pdflib. Pecl modules are always more efficient than a php solution.
DOMPdf is the easiest way to make a pdf quickly. Like Mike said, feed it html and it outputs a pdf. Under the hood, it has the option to use either r&ospdf or pdflib as the rendering engine.
http://sourceforge.net/projects/html2ps/, is the best if you need the css and 3c compatibily.
if you can install software on your server, i suggest you to use http://code.google.com/p/wkhtmltopdf/.
There is also a drupal module using wkhtmltopdf :)
PHP take many resources to convert html in pdf, imho, php is not the right language to do that (if you expect a large numbers of coversion or large files to convert)
We had to solve this problem for a client website a while back, and it was surprisingly non-trivial, so we've built the solution into a SAAS product. You just pass our service the URL of the page you want to produce as a PDF, and it returns it.
It can cope with complex layouts, interprets CSS, and allows javascript to execute before render. There are also a number of options such as security, margins and footers that can be customised.
Jake.