Printing Barcodes from webapp?

B

Burhan

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.
 
L

Leo Kislov

Burhan said:
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
 
A

Andy Dingley

Burhan said:
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.
 
B

Burhan

Andy said:
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.
 
J

John J. Lee

Andy Dingley said:
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
 
D

Dennis Lee Bieber

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).
--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 
J

John J. Lee

Dennis Lee Bieber said:
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
 
D

Dennis Lee Bieber

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...
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.

--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 
D

Dennis Lee Bieber

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!
--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 
R

Robin Becker

Dennis said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top