Reportlab and Barcodes

Jaime Wyant programmer.py at gmail.com
Thu Feb 10 08:51:01 EST 2005


That looks cleaner than mine.  I had to do this ->

# Register the barcode true-type-font
# Don't want to push the font out to everyone in the office...
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
pdfmetrics.registerFont( TTFont( 'barcode',
r'c:\inetpub\wwwroot\barcode\fre3of9x.ttf'))

# 'c' is the canvas
c.setFont( "barcode", 40  )
c.drawString( x * inch, y * inch, text )

jw

On Wed, 09 Feb 2005 11:25:22 -0800 (PST), Josh <JoshuaACohen at gmail.com> wrote:
> One of the users on the Reportlabs mailing list was kinda enough to
> offer me the solution.. A simple call to the drawOn function, e.g.:
> 
> bc = code39.Standard39("123",xdim = .015*inch)
> x = 6*inch
> y = -5*inch
> bc.drawOn(canvas,x,y)
> 
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list