Re: Barcodes

2009-08-24 Thread Chris Withers

Ronn Ross wrote:


I found this library, but no 
documentation(https://cybernetics.hudora.biz/projects/wiki/huBarcode). 
Has anyone used this or know of a similar library with better 
documentation?


Yup, reportlab has really good barcode generation stuff.
I use it to generate labels with barcodes on for asset tracking :-)

http://the-gay-bar.com/index.php?/archives/221-Howto-generate-barcodes-in-Python-with-reportlab/

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk
--
http://mail.python.org/mailman/listinfo/python-list


Re: Barcodes

2009-08-19 Thread Ronn Ross
On Wed, Aug 19, 2009 at 9:19 AM, Ronn Ross ronn.r...@gmail.com wrote:

 I was hoping that python would have a library to help me print my own bar
 codes? We will need labels in all sizes and most label printer just work
 with 1 or 2 sizes. I would like to just print a grid of different sizes on
 standard paper. Does python have a bar code printing library?



 On Mon, Aug 17, 2009 at 4:55 PM, Tim Chase 
 python.l...@tim.thechases.comwrote:

  My company needs a small inventory management app. Does
 python have any libraries to help with reading and writing
 bar codes?


 I've written bar code apps and python really doesn't enter
 into that part of things.  Printers generally have bar code
 printing capabilities so you just send the right escape
 sequences and you get the bar codes. To read them, bar code
 readers scan and translate before sending the values through
 typically a keyboard wedge or serial port.


 To add to what Emile mentions, most barcode readers present a
 keyboard-wedge interface, so that scanning a barcode merely appears as if
 you typed it at the keyboard (USB readers show up as a HID profile).  Often
 they'll have configuration barcodes that you can scan to tweak the profile
 (such as pressing enter, tab or an arrow-key after sending the barcode;
 controlling beep tone  volume, etc).

 For printing barcodes, you can use any number of solutions -- the most
 popular usually just involves installing a barcode font and then rendering
 text in that font to your desired output canvas.  I believe there are some
 native rendering solutions as well, but I've not investigated since the font
 method was more than sufficient for my wants.

 -tkc




 --
 http://mail.python.org/mailman/listinfo/python-list


 I found this library, but no documentation(
https://cybernetics.hudora.biz/projects/wiki/huBarcode). Has anyone used
this or know of a similar library with better documentation?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Printing Barcodes from webapp?

2006-12-06 Thread Robin Becker
Dennis Lee Bieber wrote:
 On Tue, 05 Dec 2006 18:19:58 GMT, Dennis Lee Bieber
 [EMAIL PROTECTED] declaimed 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

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Printing Barcodes from webapp?

2006-12-05 Thread John J. Lee
Dennis Lee Bieber [EMAIL PROTECTED] writes:

 On 04 Dec 2006 12:41:59 +, [EMAIL PROTECTED] (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

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Printing Barcodes from webapp?

2006-12-04 Thread John J. Lee
Andy Dingley [EMAIL PROTECTED] writes:

 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

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Printing Barcodes from webapp?

2006-12-02 Thread Leo Kislov

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

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Printing Barcodes from webapp?

2006-12-02 Thread Fredrik Lundh
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/Cookbook/Python/Recipe/426069
http://www.cgpp.com/bookland/
http://www.reportlab.org (see the graphics.barcode subpackage)

/F

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Printing Barcodes from webapp?

2006-12-02 Thread Andy Dingley

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.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Printing Barcodes from webapp?

2006-12-02 Thread Burhan

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.

-- 
http://mail.python.org/mailman/listinfo/python-list


Printing Barcodes from webapp?

2006-12-01 Thread 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.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Reportlab and Barcodes

2005-02-10 Thread Jaime Wyant
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 [EMAIL PROTECTED] 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

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Reportlab and Barcodes

2005-02-10 Thread Josh
Damjan,

Code39 here refers to part of the Barcode Extensions available to
Reportlabs. It can be imported as such

from reportlab.extensions.barcode import code39

Josh

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Reportlab and Barcodes

2005-02-09 Thread Benji York
Josh wrote:
I need someone to explain to me how to output a Code39 barcode to a
Reportlab PDF. 
This may not help you directly, but I've made use of it in the past: a 
very nice and totally free 3 of 9 TrueType font.

http://www.barcodesinc.com/free-barcode-font/
--
Benji
--
http://mail.python.org/mailman/listinfo/python-list


Re: Reportlab and Barcodes

2005-02-09 Thread Josh
Benji,

I have used those very same fonts before and they work great, but I'm
trying to get away with using straight Python to accomplish this,
especially since the program will most likely be used on both Linux and
Windows. 

Josh

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Reportlab and Barcodes

2005-02-09 Thread Josh
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


Re: Reportlab and Barcodes

2005-02-09 Thread Damjan
 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)

whats code39 in this example?

 x = 6*inch
 y = -5*inch
 bc.drawOn(canvas,x,y)

-- 
damjan
-- 
http://mail.python.org/mailman/listinfo/python-list


Reportlab and Barcodes

2005-02-08 Thread Josh
Hi All,

I need someone to explain to me how to output a Code39 barcode to a
Reportlab PDF. As far as I can tell, there is no means to do this with
the Canvas object, and the demo that is included with the libraries is
using the platypus Frame to place the barcode on the form. I do not
wish to use this method. I'm guessing that it needs to be placed on the
form as some type of graphic. It's obviously not going to work with the
drawText method. Any ideas? 

Thanks

Josh

-- 
http://mail.python.org/mailman/listinfo/python-list