[reportlab-users] barcode
tyson
twenger at vltool.com
Thu Sep 6 18:02:48 EDT 2007
I am having trouble resizing the barcode that I create with reportlabs.
I was able to use the example provided in the widget file and create a
barcode in the gif format. Everything about this works fine, but I need
the barcode to be larger than what it generates to. Here is the code I used:
######################################
from reportlab.graphics.shapes import Drawing
from reportlab.graphics.barcode.widgets import BarcodeStandard39
from reportlab.graphics import renderPM
d= Drawing(100,50)
#create and set up the widget
bc = BarcodeStandard39()
bc.value = 'RGB-123456'
#add to the drawing and save
d.add(bc)
d.save(formats=['gif'],fnRoot='bc_sample')
renderPM.drawtofile(d, 'barcode.png', 'PNG')
#######################################
Also, I noticed there was grayscale in between the bars. Is there a way
to make the spaces in between just white?
--
Tyson Wenger
Computer Programmer
V&L Tool,Inc.
2021 MacArthur Rd.
Waukesha, WI 53188
(262)547-1226 x178
More information about the reportlab-users
mailing list