[reportlab-users] Unable to print generated pdf
Andrew Kornilov
frutik at gmail.com
Mon Jun 18 05:46:17 EDT 2007
Hello all! I need to print label withc barcode. I wrote code for this:
#!/usr/bin/python
import sys
from reportlab.lib.units import inch
from reportlab.graphics.barcode.code39 import Standard39
from reportlab.pdfgen.canvas import Canvas
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.platypus import Paragraph, Frame
def run():
styles = getSampleStyleSheet()
styleN = styles['Normal']
story = []
string = 'TE.15K035A.SW0001'
barcode = Standard39(string)
barcode.barHeight = 0.7 * inch
barcode.lquiet = 0 # left padding
story.append(barcode)
story.append(Paragraph(string, styleN))
out = sys.stdout
out = 'out.pdf'
c = Canvas(out, pagesize=(162,108))
f = Frame(0, 0, 2.25*inch, 1.5*inch, showBoundary=0)
f.addFromList(story, c)
c.showPage()
c.save()
if __name__=='__main__':
run()
After runnig this code I have pdf. When I see it in pdf viewer - I can see
proper label with barcode and text. But when I send it to printer - prints
blank page. Any suggestions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20070618/b7b191a4/attachment.html>
More information about the reportlab-users
mailing list