[bug-pcl] RE: use Barcode Font with ghostpcl
Peter Osborne
pete at bookware3000.ca
Sat Aug 20 15:00:24 PDT 2005
Hi Paul,
I noticed your reply and gave it a try myself. Luckily, I already have a font
definition file that was purchased from HP many years ago. I took a look at
it and it ends with ESC*c5F as you mentioned. Currently, we send this file to
the printer before we send PCL. The font stays in the printers memory until
it is turned off and our documents print the barcodes nicely.
So I attempted what you did:
cat font.pcl document.pcl > final.pcl
pcl6 -sDEVICE=pswrite -sOutputFile=final.ps final.pcl
But pcl6 seg faults. When I look at the output, the program seems to die at
the first usage of the font in the document. Is it possible that pcl6 doesn't
support all font definitions or something?
Thanks,
Pete
Paul Lechnar write:
>
> Hi Dietmar.
>
> I was the one asking the question reffered to in your link :)
>
> If you follow the reply thread, you can see I had 3 choices. I took
> choice #1, which was to create a custom
> PCL font for the 3 of 9 barcode and prepend that font definition to each
> PCL job I wanted to contain the
> barcode characters. This produced a perfect match to the
> cartridge/LaserJet 4 combination we used to use.
>
> Basically, it works like this:
>
> 1. have on hand a PCL file that defines the 3 of 9 font
> 2. create a file that contains the PCL document you want to print.
>
> 3. create a new file by putting (1) and then (2) together, in that order
> (e.g. cat file1.pcl file2.pcl > file3.pcl)
> 4. Send (3) to ghostpcl (e.g. pcl2pdf file3.pcl)
>
>
> Now, the tricky part is step 1. I ended up spending about 20 hours with
> the PCL5 handbook, creating a font definition file for each character
> allowed in the 3 of 9 spec. (luckily, that's only about 60 characters,
> not 127 or more).
>
> It's kind of like this:
>
> ESCe*cnnnnnDESC)s64w < -- This starts the font definition,
> where ESC=ASCII 27 (escape char), and nnnnn=some arbritray number to ID
> your font
>
> Then each character is like:
> ESC*cnnEESC(sxxxWaaaaaaaaaaa <--- Where aaaa is some packed info about
> height, width, bitmap of dots for the letter, etc and xxx is the length
> of aaaa and nn is the ASCII value of the letter (e.g. A=65, B=66, etc)
>
> Then the end:
> ESC*c5F
>
> so the middle part is the part that takes a lot of figuring out. The
> PCL5 handbook was invaluable to me, as were some web sites that
> described the exact spacing of the vertical bars for each character in
> the 3 of 9 font. It's a boatload of work, but the end result is a
> usable font.
>
> I'm not sure I can give out the font, as the work I was doing was under
> contract and I don't actually own the font. I can help if you have tech
> questions though, just post to the list.
>
> Good luck Dietmar!
>
> Paul
More information about the bug-pcl
mailing list