Chapter 16. Creating PDFs

 

This chapter covers

  • Creating, loading, and saving PDF documents with Zend_PDF
  • Drawing text and shapes on the page
  • Adding color and styles
  • Rotating and clipping objects
  • Building an example PDF report generator

Surprising as it may seem to those of us who spend an unhealthy amount of time in the digital world, there are still people who use and need documents in paper format. Having said that, although clever use of HTML and CSS can produce well-formatted web pages, there are still limits to how pixel-perfect web pages can be, especially when it comes to printing them.

Adobe Systems created the PDF (Portable Document Format) to bridge the gap between printed and digital documents, and it has since become the standard for web-based printable documents, as well as an integral part of a modern graphics workflow. The precision of the PDF format is particularly important for documents such as specifically formatted copies of web page content, emailed invoices, site statistics, and other reports.

In this chapter, we’ll be using Zend Framework’s Zend_Pdf component to generate an example report, and we’ll work through some of its features. But before doing so, we should properly introduce the component, starting with the basics.

16.1. Zend_Pdf Basics

Using only PHP, Zend_Pdf allows you to create, load, and save PDF v1.4 documents and provides commands for drawing shapes, text, and images.

16.2. Building a PDF Report Generator

 
 

16.3. Drawing Text on the Page

 
 
 

16.4. Working with Color

 
 
 

16.5. Using Styles

 

16.6. Drawing Shapes

 
 

16.7. Rotating Objects

 
 

16.8. Adding Images to the Page

 
 
 
 

16.9. Drawing Objects within Clipping Masks

 
 
 

16.10. Generating PDF Reports

 

16.11. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest