The PDF format can be a handy way to distribute documents to your visitors. A PDF document is self-contained, looks the same on any PDF reader, and is easy to print. PDFs are often used for reports, brochures, manuals, invoices, product data sheets, and lots more.
Often it’s useful to be able to create PDF documents dynamically from within a PHP script. For example, you can produce a custom PDF report based on a user’s preferences and include up-to-the-minute data.
In this tutorial I’ll walk you through the process of creating a nice-looking, 2-page PDF document using PHP. You’ll use the freely-available FPDF library to handle the nitty-gritty of PDF creation.