By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,249 Members | 1,826 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,249 IT Pros & Developers. It's quick & easy.

Printing Barcodes from webapp?

P: n/a
Hello Group:

I am in the planning stages of an application that will be accessed
over the web, and one of the ideas is to print a barcode that is
generated when the user creates a record. The application is to track
paperwork/items and uses barcodes to easily identify which paper/item
belongs to which record.

Is there an easy way to generate barcodes using Python -- considering
the application will be printing to a printer at the client's machine?
I thought of two ways this could be done; one would be to interface
with the printing options of the browser to ensure that margins,
headers, footers are setup properly (I have done this before using
activex and IE, but with mixed results); the other would be to install
some small application at the client machine that would intercept the
print jobs and format them properly (taking the printing function away
from the browser).

Does anyone have any experience or advice? Any links I could read up
on to help me find out how to program this? Another way (easier
hopefully) to accomplish this?

Thanks for any advice.

Dec 2 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a

Burhan wrote:
Hello Group:

I am in the planning stages of an application that will be accessed
over the web, and one of the ideas is to print a barcode that is
generated when the user creates a record. The application is to track
paperwork/items and uses barcodes to easily identify which paper/item
belongs to which record.

Is there an easy way to generate barcodes using Python -- considering
the application will be printing to a printer at the client's machine?
I thought of two ways this could be done; one would be to interface
with the printing options of the browser to ensure that margins,
headers, footers are setup properly (I have done this before using
activex and IE, but with mixed results); the other would be to install
some small application at the client machine that would intercept the
print jobs and format them properly (taking the printing function away
from the browser).

Does anyone have any experience or advice? Any links I could read up
on to help me find out how to program this? Another way (easier
hopefully) to accomplish this?
I think one of the easiest ways is to install acrobat reader and
redirect client browser to a generated pdf file.
http://www.reportlab.org/ has support for generating barcodes (and
more) in pdf documents.

-- Leo

Dec 2 '06 #2

P: n/a
Burhan wrote:
Is there an easy way to generate barcodes using Python -- considering
the application will be printing to a printer at the client's machine?
here are some barcode generators for Python:

http://aspn.activestate.com/ASPN/Coo.../Recipe/426069
http://www.cgpp.com/bookland/
http://www.reportlab.org (see the graphics.barcode subpackage)

</F>

Dec 2 '06 #3

P: n/a

Burhan wrote:
Is there an easy way to generate barcodes using Python
Easy way for any application or language to generate barcodes is to
install a barcode font on the client machine, then just generate a
suitable text string for it. This is _very_ easy, if you can get the
font deployed. I usually find myself using Code 39 and printing them
from a HTML document. There are plenty of free code 39 fonts around and
the string mangling to get the barcode structured correctly is just a
trivial prefix / suffix.

Dec 2 '06 #4

P: n/a

Andy Dingley wrote:
Burhan wrote:
Is there an easy way to generate barcodes using Python

Easy way for any application or language to generate barcodes is to
install a barcode font on the client machine, then just generate a
suitable text string for it. This is _very_ easy, if you can get the
font deployed. I usually find myself using Code 39 and printing them
from a HTML document. There are plenty of free code 39 fonts around and
the string mangling to get the barcode structured correctly is just a
trivial prefix / suffix.
I thought about this as an option too, but I do not have control over
the client machines, maybe I'll use this and go with the PDF idea
mentioned above.

Thanks for all the links, I have some reading to do now.

Dec 2 '06 #5

P: n/a
"Andy Dingley" <di*****@codesmiths.comwrites:
Burhan wrote:
Is there an easy way to generate barcodes using Python

Easy way for any application or language to generate barcodes is to
install a barcode font on the client machine, then just generate a
suitable text string for it. This is _very_ easy, if you can get the
font deployed. I usually find myself using Code 39 and printing them
from a HTML document. There are plenty of free code 39 fonts around and
the string mangling to get the barcode structured correctly is just a
trivial prefix / suffix.
Sometimes that's really convenient. Depending on the barcode, this
may not always be easy, though. Certainly there are some
complications, ranging from things like relatively simple check
digits, through complicated encodings (my colleague Robin tells me US
postal bar codes were a particular pain), up to funny-looking 2D "bar"
codes like PDF417, that have lots of complicated rules associated with
them.

The ReportLab open source toolkit barcode support handles this kind of
thing for you -- for the barcodes it supports, anyway.
John

Dec 4 '06 #6

P: n/a
Dennis Lee Bieber <wl*****@ix.netcom.comwrites:
On 04 Dec 2006 12:41:59 +0000, jj*@pobox.com (John J. Lee) declaimed the
following in comp.lang.python:
digits, through complicated encodings (my colleague Robin tells me US
postal bar codes were a particular pain), up to funny-looking 2D "bar"

Really? I seem to recall coding a GW-BASIC/Epson MX-80 compatible
routine to take a zip-code and produce the bar-code for it, on a TRS-80
Mod 4. Wasn't for my use -- a co-worker wanted it (and had the "manual"
of markings allowed on an envelope).
Apparently there's a new US postal barcode, a "four state" barcode.
Presumably you drew the older simpler ones back when you were using
the TRS-80...
John

Dec 5 '06 #7

P: n/a
Dennis Lee Bieber wrote:
On Tue, 05 Dec 2006 18:19:58 GMT, Dennis Lee Bieber
<wl*****@ix.netcom.comdeclaimed the following in comp.lang.python:
> Aye, just the Postnet scheme... The difficult part was working out
the spacing for the dot-matrix printer; the rest was just using the
Zipcode digits as an index into byte-strings of MX-80 codes.

I've recently downloaded the 4-state spec from USPS... That thing is
obscene... At least Postnet could be decoded visually with a simple
chart. 4-state distributes bits all over!
well the code in reportlab/graphics/barcodes that deals with it should be
adaptable if you're interested (only around 300 lines).

I have a feeling that the UK/AU 4state codes aren't as exotic, but not having
actually implemented them it's hard to say.
--
Robin Becker

Dec 6 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.