05.05.2013 Views

Programming PHP

Programming PHP

Programming PHP

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Type, Content-Disposition, and Content-Length HTTP headers, as shown in<br />

Example 10-1. Finally, call pdf_delete( ) to free the PDF file once it’s sent to the<br />

browser.<br />

Text<br />

Text is the heart of a PDF file. As such, there are many options for changing the<br />

appearance and layout of text. In this section, we’ll discuss the coordinate system<br />

used in PDF documents, functions for inserting text and changing text attributes,<br />

and font usage.<br />

Coordinates<br />

The origin ((0,0)) in a PDF document is in the bottom-left corner. All of the<br />

measurements are specified in DTP points. A DTP point is equal to 1/72 of an inch,<br />

or 0.35277777778 mm.<br />

Example 10-2 puts text in the corners and center of a page.<br />

Example 10-2. Demonstrating coordinates<br />

<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2002 O’Reilly & Associates, Inc. All rights reserved.<br />

Text | 237

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!