[reportlab-users] Barcode: Export to image

serviciotdf at gmail.com serviciotdf at gmail.com
Sat Sep 5 09:58:43 EDT 2009


I have this code for export a barcode to pdf:

###
#!/usr/bin/python
# -*- coding: utf-8 -*-

from reportlab.pdfgen.canvas import Canvas
from reportlab.platypus import Frame
from reportlab.lib.units import mm

from reportlab.graphics.barcode import code93

def run():
string="example"
c = Canvas("barcode.pdf")
st=code93.Standard93(string)
story=[]
story.append(st)
f = Frame(10*mm, 10*mm, 190*mm, 277*mm, showBoundary=0)
f.addFromList(story, c)

c.save()

if __name__=='__main__':
run()
###

I need export only the barcode to an image (png, jpg, bmp, etc.)

It is possible with reportlab??

Bye.


More information about the reportlab-users mailing list