17.3 Output Section
The output section of a 4GL PDF report is slightly different to a normal report. It can have any of the following
LEFT MARGIN nval
RIGHT MARGIN nval
TOP MARGIN nval
BOTTOM MARGIN nval
PAGE LENGTH nval
PAGE WIDTH nval
FONT NAME "font"
FONT SIZE integer
PAPER SIZE IS A4
PAPER SIZE IS LETTER
PAPER SIZE IS LEGAL
REPORT TO "filename"
REPORT TO PIPE "progname"
nval can be any of the following :
n POINTS - PDF points 1/72 of an inch
n INCHES - Inches
n MM - metric mm
n
eg.
LEFT MARGIN 0.25 INCHES
RIGHT MARGIN 20 MM
PAGE LENGTH 60
COLUMN 10
When the units expression is omitted, n defaults to characters or lines (whichever is appropriate).
The 4GL program will use the PDFLIB fonts. If the required fonts do not exist then the program will abort with a PDFLIB error.
NOTE : Case is sensitive for these font names!
Eg.
FONT NAME "Times-Roman"
or
FONT NAME "Helvetica"
17.3.2 Report Structure
The report structure will be identical to that of a normal 4GL report.
In addition the normal 4GL report statements, you can use the following Aubit4GL PDFREPORT extensions:
SET BARCODE TYPE expr
PRINT BARCODE [NO TEXT] [AT x, y] [WIDTH w HEIGHT h]
FILL
FILL STROKE
LINE TO [TOP] y, x
MOVE TO [TOP] y, x
SET COLOR r, g, b #all 0-1
SET FILL COLOR r, g, b
SET FONT NAME name
SET FONT SIZE n
SET PARAMETER name, value
SET STROKE COLOR r, g, b
STROKE
BARCODE expr can be one of 2, 5, 8, 13, 25, 39, or QR (all quoted)
In order to generate nice reports, there are a couple of extra features available.
You can use the normal column and skip positioning mechanisms. You can use the nval values for column
eg
print column 1.1 inches,"Hello World"
but you have to use ’skip by’ for nval movements :
Eg.
skip by 2 inches
Also you now have a ’skip to’ which allows you to move to an absolute position within the current page (including backwards).
Eg.
skip to 2 inches
It is also possible to include an image within the PDF report, this is done in either of 2 wys:
-
using the PRINT IMAGE statement with a blob variable containing an image. The image must be a GIF,PNG, TIFF or JPEG and this type must be specified when displaying the image, this is done using the AS ... keyword, ie "AS GIF", "ASTIFF", "AS PNG", "AS JPEG".
-
using the PRINT IMAGE statement with a filename. Supply the absolute path to the file.
The image can be scaled when it is displayed. This can be either a single value (ie scaling x & y by the same value) or two (specifying the scaling for x & y separately)
print image some_blob_var as png
print image some_blob_var as gif scaled by 0.5.7,0.8
print image ”/local/images/oglion.png” as png
17.3.4 Example program
Please see pdf_report.4gl in test/