User Tools

Site Tools


reportlabexample

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
reportlabexample [2014/10/07 19:21]
jfp
reportlabexample [2014/10/07 19:41]
jfp
Line 4: Line 4:
  
 <file python pdfgen_hello.py>​ <file python pdfgen_hello.py>​
-#!python +c = Canvas('​pdfgen_hello.pdf')
- +
-#copyright ReportLab Inc. 2000 +
-#see license.txt for license details +
-#history http://​cvs.sourceforge.net/​cgi-bin/​cvsweb.cgi/​reportlab/​pdfgen/​test/​test_hello.py?​cvsroot=reportlab +
-#$Header: /​cvsroot/​reportlab/​reportlab/​test/​test_hello.py,​v 1.3 2002/07/24 19:56:38 andy_robinson Exp $ +
-__version__='''​ $Id'''​ +
-__doc__="""​most basic test possible that makes a PDF. +
- +
-Useful if you want to test that a really minimal PDF is healthy, +
-since the output is about the smallest thing we can make."""​ +
- +
-from reportlab.pdfgen.canvas import Canvas +
-import sys +
- +
-c = Canvas('​sys$output')+
 c.setFont('​Helvetica-Bold',​ 36) c.setFont('​Helvetica-Bold',​ 36)
 c.drawString(100,​700,​ 'Hello World'​) c.drawString(100,​700,​ 'Hello World'​)
-print '​Content-Type:​ application/​pdf\n'​ 
-sys.stdout.flush() 
 c.save() c.save()
-sys.stdout.flush() 
 </​file>​ </​file>​
 Result: Result:
reportlabexample.txt · Last modified: 2014/10/08 10:04 by jfp