Chapter 37. Zend_Pdf

Table of Contents

37.1. Introduction.
37.2. Creating and loading PDF documents.
37.3. Save changes to the PDF document.
37.4. Document pages.
37.4.1. Page creation.
37.4.2. Page cloning.
37.5. Drawing
37.5.1. Geometry
37.5.2. Colors
37.5.3. Shape Drawing
37.5.4. Text Drawing
37.5.5. Using fonts
37.5.6. Starting in 1.5, Extracting fonts.
37.5.7. Image Drawing
37.5.8. Line drawing style
37.5.9. Fill style
37.5.10. Rotations
37.5.11. Save/restore graphics state
37.5.12. Clipping draw area
37.5.13. Styles
37.5.14. Transparency
37.6. Document Info and Metadata.
37.7. Zend_Pdf module usage example

37.1. Introduction.

Zend_Pdf module is a PDF (Portable Document Format) manipulation engine written entirely in PHP 5. It can load existing documents, create new, modify and save modified documents. Thus it can help any PHP-driven application dynamically prepare documents in a PDF by modifying existing template or generating document from a scratch. Zend_Pdf module supports the following features:

  • Create new document or load existing one. [2]

  • Retrieving specified revision of the document.

  • Manipulate pages within document. Changing page order, adding new pages, removing pages from a document.

  • Different drawing primitives (lines, rectangles, polygons, circles, ellipses and sectors).

  • Text drawing using any of the 14 standard (built-in) fonts or your own custom TrueType fonts.

  • Rotations.

  • Image drawing. [3]

  • Incremental PDF file update.



[2] PDF V1.4 (Acrobat 5) documents are supported for loading now.

[3] JPG, PNG [Up to 8bit per channel+Alpha] and TIFF images are supported.