Helping ordinary people create extraordinary websites!

Easy PDF Generation in PHP

By Akash Mehta
2008-03-01

Options for PDF Generation

In this article, we'll take a look at FPDF. However, you may have noticed a section in the PHP manual itself with PDF functions. A brief look at php.net/pdf reveals a PDFLib-based PECL extension that has not been updated in nearly six months. PDFLib itself is not free, however, and PDFLib Lite is not terribly effective. You also need access to the server to install the extension, which isn't always possible on a shared host.

There is a special section in the PHP manual on this - take a look at this FAQ entry. The two main free alternatives to FPDF are the R&OS PDF Class and phppdflib, but neither have been updated in a few years. There's also the Zend_PDF component of the Zend Framework, although it isn't very mature - still worth a look if you use the Zend Framework, however. In this time, FPDF has become the de facto standard for PDF generation in PHP. Other options exist - such as using COM to communicate with an existing Windows application with PDF export functionality - however none are as reliable and flexible as FPDF. In this tutorial, we'll be using FPDF exclusively, but the alternatives are definitely worth a look, especially their source code.





Tutorial pages:
 5 Votes

You might also want to check these out:


Leave a Comment on "Easy PDF Generation in PHP"
You must be logged in to post a comment.

Link to This Tutorial Page!


GET OUR NEWSLETTERS