Adding Text to PDFs

Obviously, you'll want to do more with your PDFs than just generate blank documents. The most important thing to be able to do is to add text, which you'll learn here.

Placing text within PDF documents is not nearly as easy or straightforward as you might think. Text cannot just be written down the page from left to right, top to bottom, as you can in your text editor or Web browser. Text in PDFs must be placed on the page as you would place points and lines on a graph. In fact, you can place the text in nearly any order and result in the same page (assuming no overlaps), but I still find it makes the most sense to code your way from the top down.

One of the trickier aspects of PDF generation is that the lower-left corner ...

Get PHP Advanced for the World Wide Web: Visual QuickPro Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.