[reportlab-users] pdf417 barcodes

Carl Karsten carl at personnelware.com
Fri Jan 2 11:08:44 EST 2009

Dinu Gherman wrote:

> Carl Karsten:


>>> I've done something like that for EuroPython 2008, or let's

>>> say I offered doing it, but people said for about 200 people

>>> the scanning wouldn't make much sense, which is mostly true.


>> How were you going to implement it?


> Well QR codes can be read with cameras in mobile phones (with

> appropriate software) if that is what you mean.

No, I meant how were you going to code the reportlab side. mainly passing the
(name,email...) to the code that encodes to the barcode, then getting whatever
it returns (bmp, ps, eps, etc) into reporlab.

I have a friend that has done cTypes before, and is going to look into making
bindings for https://sourceforge.net/projects/pdf417encode/


>>> For PyCon US and the general fear level in the US that might

>>> be different. Here's a sample with the (not so meaningful)

>>> QR codes generated by an online service and added as bitmaps

>>> to the badges PDF file (in the end I made them much simpler):

>>> http://python.net/~gherman/tmp/badges.pdf


>> neat.


>> Can you post the code?


> Seems like I cannot find it right now, or it was throw away code.

No problem. I am guessing it wasn't anything super complex, just wondering how
automated you got it.

For a sample (no real data, this is kinda like a unit test)

>>> demog="31443 \03First
\03Last\03\nTitle\03\nOrganization1\03\nAddress1\03\nAddress2\03\nCity \03St
\00312345\03\nUSA\03\nPhone: \003123-456-7890\03\nFax:
\03987-654-3210\03\nEmail: \03test at email.com\03\n1: \03\03\n2: \03\03\n3:
\03\03\n4: \03\03\n\n\n\n\n\n"
>>> open('ncta.txt','w').write(demog)

$ ./pdf417prep <ncta.txt >ncta.prep
$ ./pdf417_enc -t pbm ncta.prep ncta.pbm
$ convert ncta.pbm ncta.png

>>> barcode=open('ncta.png').read()

And then referenced ncta.png in my dabo code witch feeds reportlab.

Carl K

More information about the reportlab-users mailing list