Printing Barcodes from webapp?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Burhan

    #1

    Printing Barcodes from webapp?

    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.

  • Leo Kislov

    #2
    Re: Printing Barcodes from webapp?


    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

    Comment

    • Fredrik Lundh

      #3
      Re: Printing Barcodes from webapp?

      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://www.reportlab.org (see the graphics.barcod e subpackage)

      </F>

      Comment

      • Andy Dingley

        #4
        Re: Printing Barcodes from webapp?


        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.

        Comment

        • Burhan

          #5
          Re: Printing Barcodes from webapp?


          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.

          Comment

          • John J. Lee

            #6
            Re: Printing Barcodes from webapp?

            "Andy Dingley" <dingbat@codesm iths.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

            Comment

            • John J. Lee

              #7
              Re: Printing Barcodes from webapp?

              Dennis Lee Bieber <wlfraed@ix.net com.comwrites:
              On 04 Dec 2006 12:41:59 +0000, jjl@pobox.com (John J. Lee) declaimed the
              following in comp.lang.pytho n:
              >
              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

              Comment

              • Robin Becker

                #8
                Re: Printing Barcodes from webapp?

                Dennis Lee Bieber wrote:
                On Tue, 05 Dec 2006 18:19:58 GMT, Dennis Lee Bieber
                <wlfraed@ix.net com.comdeclaime d the following in comp.lang.pytho n:
                >
                > 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

                Comment

                Working...