Chapter 14. Zend_Pdf

Table of Contents

14.1. Introduction.
14.2. Creating and loading PDF documents.
14.3. Save changes to the PDF document.
14.4. Document pages.
14.5. Drawing.
14.5.1. Geometry.
14.5.2. Colors.
14.5.3. Shape Drawing.
14.5.4. Text Drawing.
14.5.5. Using fonts.
14.5.6. Image Drawing.
14.5.7. Line drawing style.
14.5.8. Fill style.
14.5.9. Rotations.
14.5.10. Save/restore graphics state.
14.5.11. Clipping draw area.
14.5.12. Styles.
14.6. Zend_Pdf module usage example.

14.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. [1]

  • 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. [2]

  • Incremental PDF file update.



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

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