Specifications

PDFlib works in points, both for page size, and for locating coordinate locations on each page.
For reference, A4 is approximately 595 by 842 points and U.S. letter is 612 by 792 points. This
means that our line
pdf_begin_page($pdf, 8.5*72, 11*72);
creates a page in our document, sized for U.S. letter paper.
A PDF document does not need to be just a printable document. Many PDF features can be
included in the document such as hyperlinks and bookmarks. The function pdf_add_outline()
will add a bookmark to the document outline. The bookmarks in a document will appear in a
separate pane in Acrobat Reader, allowing us to skip straight to important sections.
This line
pdf_add_outline($pdf, “Page 1”);
adds an outline entry labeled Page 1, which will refer to the current page.
Fonts available on systems vary from operating system to operating system and even from indi-
vidual machine to machine. In order to guarantee consistent results, a set of core fonts will
work with every PDF reader. The 14 core fonts are
Courier
Courier-Bold
Courier-Oblique
Courier-BoldOblique
Helvetica
Helvetica-Bold
Helvetica-Oblique
Helvetica-BoldOblique
Times-Roman
Times-Bold
Times-Italic
Times-BoldItalic
Symbol
ZapfDingbats
Fonts outside this set can be embedded in documents, but this will increase the file size and
might not be acceptable under whatever license you own that particular font under. We can
choose a font, its size, and character encoding as follows:
Building Practical PHP and MySQL Projects
P
ART V
768
36 7842 CH30 3/6/01 3:40 PM Page 768