PDF is the Portable Document Format developed by Adobe. It’s an open standard implemented by Adobe in their Acrobat series of software, but implementable and extensible by anybody who’s got the time, inclination, and knack. One trick that’s got a lot of potential is using PHP to dynamically generate PDF files and serve them via the web.
PHP can do a lot for your web operation (read our PHP Tutorial for Beginners tutorial). You can generate nice-looking printable receipts, invoices, and brochures. Disc-Cover has a test site that looks up info about a CD automatically and then generates a PDF label for the CD box that you can print, cut out, and use. And there are literally one billion other possible uses for dynamically generated PDFs.
So what are you waiting for?
You have a variety of PDF-generation options. The standard, classic way of doing it is with PDFlib. Because it’s so widely used and well-integrated into PHP, that’s the library I’ll go over today. But it’s by no means the only way of doing things. PDFlib is source-available, but not free. The license specifies that PDFlib can be used and redistributed without charge for non-commercial projects, but commercial use carries a fee.
There are also a number of completely free options. These include R&OS and FPDF, Panda. The choice is yours. (I haven’t had a chance to test these free packages very thoroughly. If you have had negative or positive experiences with them, please do let me know.)
Continue Reading “Generate PDFs Dynamically With PHP” »
Now you can attend OSCon for free. Well, sort of. Book publisher and conference organizer O’Reilly has shared
Browse Our Tutorials
Cheat Sheets
Color Charts
Cut & Paste Code