Skip to content

Instantly share code, notes, and snippets.

@luxinyan
Created April 23, 2014 03:54
Show Gist options
  • Save luxinyan/11202273 to your computer and use it in GitHub Desktop.
Save luxinyan/11202273 to your computer and use it in GitHub Desktop.
python generate pdf with reportlab.
'''
This is a simple code for generate pdf with reportlab.
More information:http://www.reportlab.com/software/opensource/rl-toolkit/faq/
'''
from reportlab.pdfgen import canvas
from reportlab.lib.units import cm
my_pdf = canvas.Canvas("hello.pdf")
my_pdf.drawString(9*cm, 22*cm, "Hello World!")
my_pdf.showPage()
my_pdf.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment