PHP
  Home arrow PHP arrow Anatomy of an Output Class
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Anatomy of an Output Class
By: Daryl Houston
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2003-07-16

    Table of Contents:
  • Anatomy of an Output Class
  • PDF Basics
  • Writing PDFs
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Anatomy of an Output Class


    (Page 1 of 4 )

    What should be considered when one in given the task of generating PDF reports? Daryl will explain some aspects that come with this daunting task. Upon changing employers recently, I found that I had inherited a rat's nest of code used to generate project reports in PDF form on the fly. For each of our clients, there were numerous reports, all broken down into individual files with a staggering amount of code duplication and general redundancy. And I had the dubious honor of combing through these files in order to add columns to some tabular reports.

    Generating PDFs is nothing like generating HTML. Everything you print to the page is pegged to coordinates on a grid rather than floating freely on the page within vague dimensional constraints. And so adding a column to an existing tabular report in PDF can be a nightmare. 

    After spending a frustrating morning crossing my eyes at thousands of lines of code while counting columns and calculating character widths and changing coordinates until the adjustments were finally correct, I decided to write a class that would handle all of this drudgery for me. What's more, I decided that the class should be useful for more than PDF output, and I built in support for HTML, XLS, and XML output as well.

    The resulting code itself, while sufficient to handle the bulk of my needs, isn't quite ready for a public consumption yet, but some of the choices (and mistakes) I made while developing it might prove useful to others working on similar tasks. Accordingly, I offer here an account of how I brought an output class to life.

    More PHP Articles
    More By Daryl Houston


     

    PHP ARTICLES

    - Making Usage Statistics in PHP
    - Installing PHP under Windows: Further Config...
    - File Version Management in PHP
    - Statistical View of Data in a Clustered Bar ...
    - Creating a Multi-File Upload Script in PHP
    - Executing Microsoft SQL Server Stored Proced...
    - Code 10x More Efficiently Using Data Access ...
    - A Few Tips for Speeding Up PHP Code
    - The Modular Web Page
    - Quick E-Commerce with PHP and PayPal
    - Regression Testing With JMeter
    - Building an Iterator with PHP
    - PHP Frontend to ImageMagick
    - Using PEAR's mimeDecode Module
    - Incoming Mail and PHP







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway