lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Synthesizing POSTNET barcodes using Graphics ?


From: Jeff Kingston
Subject: Re: Synthesizing POSTNET barcodes using Graphics ?
Date: Thu, 26 Sep 2002 12:36:10 +1000

The structure of what you are doing is very similar to the @Eq equation
formatter.  You need something like this:

    def @BarCode
        body x
    {
        def "0" { ...stuff for the bar code for 0... }
        def "1" { ...stuff for the bar code for 1... }
        ...
        def "9" { ...stuff for the bar code for 9... }

        x
    }

This should allow you to write

    @BarCode { 1234 }

and the 1, 2, 3, and 4 inside will be recognised as the symbols
you've defined inside the body of the @BarCode definition.  But
outside the right parameter of @BarCode, 1, 2, 3, 4 etc have
their usual meaning.

All you need now is code for the individual characters.

If some of your codes are for letters rather than digits then
you will need spaces around the letters since otherwise Lout
will treat sequences of letters as individual symbols.  

Jeff Kingston


On Wed, 25 Sep 2002 03:17:28 +0400 (MSD), p17501 wrote:
  > 
  > I have a need to generate POSTNET barcodes, (the little bars at the
  > bottom of a US address), and have found some Postscript code that
  > generates it, but would think it would be cleaner to generate directly
  > in side of lout.  I am using TCL as my scripting language, so the
  > check digit can be determined before hand. 
  > 
  > I have tried using @IncludeGraphic but the PS that is there does not
  > calculate the BoundingBox.
  > 
  > I have posted the two snippets of current code at
  > 
  > http://new.zill.net/postnet1.html
  > and 
  > http://new.zill.net/postnet2.html
  > 
  > And would appreciate any help or suggestions in converting this into
  > lout format.  I think that creating a macro for 5-digit zip and
  > another for zip+4 would work, but again, anything that needs to be
  > done manually I will handle within the TCL program.
  > 
  > Cordially
  > 
  > Patrick Giagnocavo
  > address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]