Generating PDFs with PHP and FPDF (and TCPDF)

Now available as an eBook!

Amazon.com (US)

Amazon.co.uk

Amazon.de

Download a 10-page PDF sample chapter

This book shows you how to use the well-known and completely free FPDF library to generate PDFs directly from your PHP program. All of the functions are explained clearly and with numerous examples. Included are numerous extensions provided by contributed scripts on the FPDF.org website. These bring FPDF much closer to the TCPDF library than many people think is the case, as this book proves. That part of TCPDF that overlaps the functionality covered here is also explained, with TCPDF examples, too.

All of the PHP source code for the examples is available for download, and you may freely use it in your own applications.

Table of Contents


1 About FPDF and TCPDF
2 Installation
3 Simple Examples
4 Multiple Pages
5 Absolute Positioning Functions
6 Drawing Attributes
7 Constructor and Page Setup
8 International (Unicode) Characters
9 Margins and Flowing Text
10 Cells and String Widths
11 Summary of Text Functions
12 Headers and Footers
13 Controlling Output
14 Snaking Columns
15 Adding Fonts
16 Links
17 PDF Properties
18 Tables
19 Embedding PostScript
20 Bookmarks
21 Rotation and Watermarks
22 Ellipses, Circles, Rounded Rectangles, and Sectors
23 Advanced Geometric Figures
24 Transparency
25 JavaScript
26 Forms
27 Barcodes
28 Protection
29 Solutions to Common Problems
Index to Functions