Related Entries

India PyCon 2009
Quick wallpaper changer
Load testing with Grinder
Adding namespace to XML
Opera RSS to OPML

« Java, language of tomorrow
» Nucular?

ReportLab -Python PDF

Cameron Laird writes another great article.

Head over to IBM developerWorks for a great article on making PDF using ReportLab, by Cameron Laird.

See how simple it is to make a "Hello World" PDF!

from reportlab.pdfgen import canvas
from reportlab.lib.units import inch

font = "Helvetica"
font_size = 26
text = "Hello, world"
x = 5.0 * inch
y = 8.0 * inch
destination_file = "/tmp/first.pdf"

my_canvas = canvas.Canvas(destination_file)
my_canvas.setFont(font, font_size)
my_canvas.drawRightString(x, y, text)
my_canvas.save()

It has a superb collection of links to different PDF resources as well.

  1. Comments

    Posted by: xulixin on February 4, 2003 07:35 PM
//-->