Printing Barcodes Without an IPDS Printer
June 23, 2004 Hey, Mike
I’ve been given a challenge and don’t know where to start. I’ve been asked to add a “code 3 of 9” barcode to a picking list, which is an SCS report. The only way they’ve ever produced barcodes is with an IPDS printer. They want the iSeries to print to a laser printer instead, since laser printers are cheaper than IPDS printers. They also would prefer not to embed printer control codes in RPG output. Is this doable?
–Thad
It is possible (and easy!) to print barcodes on a laser printer if the printer file is externally described.
First, use Display Device Description (DSPDEVD) to check the host print transform attribute. It needs to have a value of *YES. Use the Change Device Desc (Printer) (CHGDEVPRT) command to change the device if necessary.
Second, add the BARCODE keyword to the printer file. (See the DDS manual for more information about this splendid keyword.)
A H1ID 12 O 4 41BARCODE(CODE3OF9 *HRZ *NOHRI *NOAST)
Third, create the printer file as DEVTYPE(*AFPDS).
CRTPRTF FILE(xxx/PICKLIST) + SRCFILE(xxx/QDDSSRC) + SRCMBR(PICKLIST) + DEVTYPE(*AFPDS)
–Mike Sansoterra
Michael Sansoterra is a programmer/analyst for i3 Business Solutions, an IT services firm based in Grand Rapids, Michigan. E-mail: msansoterra@i3BusinessSolutions.com