Link to home
Start Free TrialLog in
Avatar of penguins_rule
penguins_ruleFlag for United States of America

asked on

USPS imb barcode for HP laser printer on linux needed

I need to be able to print the USPS intelligent mail barcode (IMB) using a laser printer and PCL commands. My software generates text files with embedded commands for the laser printer. I am looking for information to add the font as a soft font. I print using CUPS, and have the printer defined as raw.
Avatar of DansDadUK
DansDadUK
Flag of United Kingdom of Great Britain and Northern Ireland image

PCL soft fonts come in a number of different formats:
format 0 - bitmap (deprecated)
format 10 - Intellifont scalable bound
format 11 -  Intellifont scalable unbound
format 15 - TrueType scalable
format 16 - Universal
format 20 - resolution-specified bitmap

With the bitmap formats, you can probably 'hand-craft' the required font (but you'll need a separate font for each required size).

The Intellifont formats are little used these days (and there is very little documentation available about them), so I'd ignore these.

The Universal format is (more-or-less) like the TrueType format, but can cater for larger fonts.

Generating PCL-format TrueType or Universal fonts is not a trivial process; note that they are not just copies of a standard TrueType display font.

If you have a Windows system (as well as your *n*x one), and a licensed copy of a TrueType version of your intelligent mail barcode font, you could use the Soft Font Generate tool in the (Windows-only) PCL Paraphernalia application, available via http://www.pclparaphernalia.eu to generate a format 15 or format 16 soft font, which your bespoke software could download to the printer when needed.
... and for (some) technical documentation of the PCL soft font formats, the following link provides a brief history of the PCL language, and links to the PCL5 Technical Reference manual, and also to other PCL5 & PJL manuals:

http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpl04568

The PCL5 Technical Reference manual (Part 1) includes a chapter on PCL soft fonts; although it goes into quite some detail, there is insufficient information to allow you to generate anything other than the bitmap formats.
Avatar of penguins_rule

ASKER

I pulled a file which has the HP PCL font: uspsFontsNonAFP-1.4.0.zip from the usps website (https://ribbs.usps.gov/onecodesolution/download.cfm).
I tried to cat the US23HP.FNT and my text file. The printer did not print anything at all.
The other thing I do not know is what data to use for the font? Do I use A F T D?
I'll have a look at the content of the .zip file you refer to in the morning (UK time-zone).
ASKER CERTIFIED SOLUTION
Avatar of DansDadUK
DansDadUK
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
... and the prfiles\hp folder contains four 'print ready' PCL sample print jobs to demonstrate the four fonts.

The attached analyses show what these print jobs contain.

Note that each of them (as well as including the superfluous <NUL> bytes at the end of the font download sequence, also include an invalid PCL escape sequence which the printer will probably ignore.

I suspect that these sequences were supposed to select the required font height - but this is (fortunately) irrelevant, since  (in each case) the required fixed-size (bitmap) font has just been selected via its download font identifier.
PCLsamplesPR.zip
In the US23P file, the invalid PCL sequence should have been <Esc>(s10.5V  to select the proper font.
Also, as you pointed out, the font-id is 30000.
>> ... In the US23P file, the invalid PCL sequence should have been <Esc>(s10.5V  to select the proper font ...

You are correct in your assumption of the likely correct value of the invalid PCL sequence.
But it is superfluous anyway in this context, since the (non scaleable) bitmap font (of a fixed size) has already been selected via its download identifier.


>> ... the font-id is 30000 ...

The font identifier used in the font ID sequence (<Esc>*c#D) can be any value you want it to be, within the range  0 - 32767; you just have to make sure that when you want to select it by identifier (using the select font by ID sequence (<Esc>(c#X or <Esc>)c#X)), rather than via characteristics, that you use the same identifier.
i was not able to get the soft font to load onto the laser printer.
I found a product from Typehaus BarCodeJet which may have the capability i am seeking.
>> ... i was not able to get the soft font to load onto the laser printer ...

Not really sure just what problem you may have had here.

I sent the content of each of the four 'print ready' PCL sample print job files direct to the port of my LaserJet 1320n printer, and they all appeared to print OK (with sample bar-code), which seems to verify that the embedded soft font files are valid.

I think (not sure) that with some modern LaserJet printers, it may be the case that downloaded soft fonts (even if set 'permanent') are discarded when the device goes into 'sleep' mode, so you can't necessarily 'load' the font at start of day, and expect to use it later.
... and even 'permanent' soft fonts have always been deleted if the printer is powered off, or if certain PCL 'font handling' escape sequences are received by the device.