14.35 PDF Reports
Built using PDFlib, allows you to produce reports in PDF format with fancy fonts.
The following demonstrates how how to create barcodes of different types
# PDFREPORT
#
# Example for barcode ean-13
# with addon ean-2 and ean-5
# and use of ean-8
#
# Contributed by Michael Krauss
# mike@holzamer.de
DEFINE i INTEGER
MAIN
START REPORT pgtrex to "example.pdf"
FOR i = 1 TO 20
OUTPUT TO REPORT pgtrex(i)
END FOR
FINISH REPORT PGTREX
RUN "acroread ./example.pdf"
END MAIN
PDFREPORT pgtrex(r)
DEFINE r INTEGER
OUTPUT
TOP MARGIN 0 INCHES
LEFT MARGIN 0.5 INCHES
RIGHT MARGIN 0.1 INCHES
BOTTOM MARGIN 0.2 INCHES
PAPER SIZE IS a4
FORMAT
PAGE HEADER
#text format "utf8"
SET FONT NAME "Times-Roman"
SET FONT SIZE 8
SET BARCODE TYPE "13"
SKIP TO 25 mm
PRINT COLUMN 0.5 INCHES;
PRINT BARCODE "4023500760409"
WIDTH 1.8 INCHES HEIGHT 0.8 INCHES
SET BARCODE TYPE "5"
SKIP TO 25 mm
PRINT COLUMN 2.4 INCHES;
PRINT BARCODE "08000"
WIDTH 0.6 INCHES HEIGHT 0.7 INCHES
SKIP TO 60 mm
PRINT "The barcode type ’13’ is one carton of Marlboro",
" with 10 packages ",
"and the price (barcode type ’5’) of €80.00."
SKIP 1 LINE
PRINT "Example of Tabacco-Branch:"
PRINT "digit 1 to 3: ’402’ is the branch number."
PRINT "digit 4 to 7: ’3500’ is the company number."
PRINT "digit 8 to 12: ’76040’ is the article number."
PRINT "digit 13; checksum"
PRINT "But the use of digits and their definition ",
"is from branch to branch and country different."
SET BARCODE TYPE "8"
SKIP TO 95 mm
PRINT COLUMN 0.5 inches;
PRINT BARCODE "40235462"
width 1.2 inches height 0.7 inches
SKIP TO 125 mm
PRINT "The barcode type ’8’ is one package of Marlboro."
SKIP 1 LINE
PRINT "Example:"
PRINT "digit 1 to 4: ’4023’ is the company number."
PRINT "digit 5 to 7: ’546’ is the article number."
PRINT "digit 8: checksum"
SET BARCODE TYPE "13"
SKIP TO 150 mm
PRINT COLUMN 0.5 inches;
PRINT BARCODE "4196176209951"
WIDTH 1.8 inches HEIGHT 0.8 inches
SET BARCODE TYPE "2"
SKIP TO 150 mm
PRINT COLUMN 2.4 inches;
PRINT BARCODE "52"
WIDTH 0.2 inches HEIGHT 0.7 inches
SKIP TO 190 mm
PRINT "This example of ean-13 is a Magazine. "
"The ean-2 is the issue, week number 52 of year."
END REPORT