|
Symptom
How can 2-D barcodes (for example, PDF417) be printed from SAPscript-forms?
Additional key words:
Hewlett-Packard, SAPscript, 2-D bar code, PDF417, HP LaserJet, LaserJet Printing Solutions
Cause and pre-requisites:
There is a need for this information.
Solution:
As outlined in Note 5196, SAPscript supports printing bar codes if barcode functions are supported by the output device being used (for example, a printer which is able to print barcodes or barcode software). The number of characters which are coded in a barcode are limited for one dimensional barcodes which are supported in
SAPscript. Therefore SAPscript has an upper limit of 70 characters which can
be maximally transferred as data to be output for a barcode.
|
Because 2-D barcodes such as PDF417 are used to encode substantially larger datasets
(between a few hundred to more than one thousand lines per barcode),
problems occur in SAPscript when you use this "large" barcode data. This
note serves to demonstrate a practical workaround to avoid this restriction.
The following products are supported for printing 1-D or 2-D barcodes from SAPscript to laser printers (Note 5196):
JetMobile Intelligent Bar Code SIMM for hp LaserJet printers (Note 121305)
Printing 2-D bar codes with label printers: Note
135894 gives information on printing labels from SAPscript. The printer/label
programs mentioned in the related notes usually support printing 2-D bar
codes. |
General notes on the procedure for 2-D bar codes and SAPscript
You must consider the following points when you layout a SAPscript form in which you want to output a PDF417 2-D bar code. - the bar code string to be output must not contain a line break (this would lead to an error in the printer access of bar code SIMM). Therefore, the string must fit into a single line of the current form window. For this reason, you
should select the smallest possible (that is the narrowest possible)
font. Note: Since most device types do not support fonts smaller than 6
point copy the device type to Zxxxxxx (Note 3166) and create a printer
font COURIER 020 _ _ 99.99 CPI SF999 SF999 (Note 12462). Use this font as
font for the barcode text (print control SF999 should not contain any print
command). Due to the scale interval of 99.99 cpi (character by inch) you can
enter 799 characters as barcode data in the SAPscript form when the window
size is 8 inch until a line break occurs. To use the new printer font a
system font COURIER 020 _ _ has to be defined in Transaction SE73. After
this, define a character format with font attributes COURIER 020 in the
SAPscript form. - the printer command for activating the bar code function of
the printer is either stored completely or partly in a print control
called in the form prior to the bar code string to be output. - to avoid
that the SAPscript printer driver inserts a font command between the first
print control and the bar code string a blank character (<32>) needs to
be output before the print control. This forces the font switch prior to the
font control. The printer command for deactivating the bar code function of
the printer must be called with a print control at the end of the barcode string to be output. |
Example for PDF417 and JetMobile BarSIMM (hp laser jet printer):
/: DEFINE &XDIM& = 2 /: DEFINE &YDIM&
= 3 /: DEFINE &MODHEIGHT& = 3 * <FS><32> /:
PRINT-CONTROL SESCP =
(s1p&XDIM&,&YDIM&,&MODHEIGHT&,0s24850T =
&BARCODEFIELD1&&BARCODEFIELD2& /: PRINT-CONTROL
SBS01 regular text continues here
With the code mentioned above the
content of the fields BARCODEFIELD1 and BARCODEFIELD2 is output as PDF417 bar
code. HPLJ4/HPLJ5/HPLJ4000 must be used as a device type. The character
format FS activates in this case the smallest possible font (without
modification point 6) when using the modification mentioned above (point
2). In this case, the complete printer command for
PDF417, ESC(s1p2,3,3,0s24850T may alternatively be stored in a privately
defined print control ZPDF4.
In this case, the SAP device type needs to be
copied to Zxxxxx and modified accordingly. The example would then read: *
<FS><32> /: PRINT-CONTROL ZPDF4 =
&BARCODEFIELD1&&BARCODEFIELD2& /: PRINT-CONTROL
SBS01 regular text continues here
You can find the meaning of the
individual parameters of the PCL-5 printer commands for PDF417 in the
documentation for jetmobile BarSimm.
The contents of the BARCODEFIELD1,
BARCODEFIELD2 fields are output as a PDF417 bar code when you use the
aforementioned coding.
A modified copy Zxxxx of HPLJ4/HPLJ5/HPLJ4000 must be used as a device type.
In this case, character format FS activates the smallest possible
font (without modification point 6, otherwise 2). The print control ZPDF4
must be defined in the copy Zxxxx of the SAP device type as follows
(hexadecimal notation): Name: V: H: printer command: ZPDF4 1 X
1B267831365700010402000802000000010400000000 |
|