View Full Version : Autogeneration of PDFs for PHP based site

06-22-2010, 12:15 PM

I have a site which is written up in PHP and has a page with various products for sale, pulled from a mySQL database.

What we need to be able to do is have a way of autogenerating a PDF version of the "product detail" page, so that certain items (product description, the main photos, technical details etc.) on the page are bundled into a PDF which is generated for the user and which they can then save, print etc. just as they would with any PDF.

It should be dynamic, in that if changes are made to the product, when the user next clicks the "Download as PDF" link for that product, the changes are incorporated.

I know it's possible to just manually make PDFs based on the product pages and put them up on the site, but this means a lot of extra maintenance (remaking PDFs whenever products change etc.)

Any idea if and how this can be achieved?

Phil Jackson
06-22-2010, 02:04 PM
you have to have full control of your server ( dedicated ) or a shared host that has certain php extensions installed. there are some classes, but they are poo.

Another option to use good old perl to process the creation of pdfs.

06-22-2010, 02:16 PM
Do you know which extensions have to be installed on the server for this to work?

A few people have mentioned FPDF to me- any good or best avoided?

Lastly, I don't know any Perl so unfortunately that isn't an option...