Python
  Home arrow Python arrow Python for PDF Generation
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Developerworks
 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? 
PYTHON

Python for PDF Generation
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 42
    2006-03-14

    Table of Contents:
  • Python for PDF Generation
  • Putting Virtual Ink to Virtual Paper
  • Text Formatting Techniques
  • Using Graphics

  • 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

    Virtual Tradeshows by Ziff Davis Enterprise - A Unique Opportunity to Connect with IT Experts, Access Information, and Gain Insight on today's Technology

    Python for PDF Generation
    (Page 1 of 4 )

    The Portable Document Format (PDF) lets you create documents that look exactly the same on every platform. Sometimes a PDF document needs to be generated dynamically, however, and that can be quite a challenge. Fortunately, there are libraries that can help. This article examines one of those for Python.

    The aim of the Portable Document Format is noble. Every page should look exactly the same on any platform, regardless of user settings. If a user were to view a certain web page on my computer and then switch the resolution, the change could be quite significant. Likewise, if a user viewed a web page or some other sort of document on Windows and then switched to Linux, things might also look very different. This is fine for a lot of things, but when pages need to be formatted in a precise way, as in books or user manuals, it becomes a problem. It is, however, a problem that can easily be solved by creating PDF documents for things like these.

    PDF documents are fairly easy to create today. All someone has to do is click a button or a menu option in his favorite word processing application, or he can simply print a page to a PDF file. However, there are certain situations where this cannot be done, such as when a PDF document needs to be generated dynamically. This is where programming comes in. There are a number of libraries designed to work with a number of languages to generate PDF documents. This article will examine the ReportLab Toolkit for Python.

    Obtaining the ReportLab Toolkit

    The ReportLab Toolkit may be obtained from the ReportLab website:

    http://www.reportlab.org/downloads.html

    Extract the archive and then run the install script:

    $ python setup.py install

    If you plan on working with images, you'll also need the Python Imaging Library (PIL):

    http://www.pythonware.com/products/pil

    If you're on Windows, just download and run the binary installer. Otherwise, download the source, extract it and run the installation script:

    $ python setup.py install

    Again, you'll need  the proper permissions.

    More Python Articles
    More By Peyton McCullough


       · Hello,PDFs are pretty popular and have been like that for a while. Government...
       · Thanks for the tutorial. I'm on page 1 and have my first PDF in 5 minutes. I'm a...
     

       

    PYTHON ARTICLES

    - SSH with Twisted
    - Mobile Programming in Python using PyS60: UI...
    - Python: Count on It
    - Python Strings: Spinning Yarns
    - Python: More Fun with Strings
    - Python: Stringing You Along
    - Python Operators
    - Bluetooth Programming in Python: Network Pro...
    - Python Sets
    - Python Conditionals, Lists, Dictionaries, an...
    - Python: Input and Variables
    - Introduction to Python Programming
    - Mobile Programming in Python using PyS60: Ge...
    - Bluetooth Programming using Python
    - Finishing the PyMailGUI Client: User Help To...

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




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