Pdfinclude: Progress® Open Source Adobe® PDF Development
Pdfinclude: Progress® Open Source Adobe® PDF Development
www.epro-sys.com
Contributors
Julian Lyndon-Smith of DotR (www.dotr.com)
Peter Kiss of Paradyme N.V
Herbert Bayer of B&R Innovative DV-Lösungen GmbH (
www.bundrinno.de)
Steven Jellin of ELCB (www.elcb.co.za)
Steve Southwell of Bravepoint (www.bravepoint.com)
John Stonecipher of Indiana Packers (www.inpac.com)
Paul Keary of Coe Press Equipment (www.cpec.com)
plus many others … (apologies to those not listed)
Problem
Reports and text output, in general, is boring
Many use pre-printed forms as solution
Expensive
Inflexible
One printer, one type of form
Have to line-up text to fit in pre-printed boxes
Miss many opportunities since you can’t print barcodes
on forms
Barcode fonts and cartridges are printer-specific
Some Solutions
Barcode cartridges (for printers)
Send printer-specific Control Codes from 4GL
Use plain text, one font only
Create templates to be stored in printer’s
memory and called via escape codes in 4GL
Best Solution
Create your own forms from 4GL
Print on any printer, view on any computer
Not a printer specific solution
Use Barcodes at will
Use Graphics (images and logos) anywhere
Change font sizes, colours, orientation
Print on plain paper
Easily distributable content
Download at http://pdfinclude.epro-sys.com
PDFinclude Overview (2)
PDFinclude has been deployed by companies in the following
countries:
Canada South Africa
USA Hong Kong
Britain Portugal
Belgium France
The Netherlands Romania
Sweden Hungary
Australia Norway
Argentina
Singapore Plus many more
PDFinclude Overview (3)
PDFinclude has been deployed in the following:
Usage
Print/E-Mail PDF from MFG/PRO E-Mail Distribution
Internal Report Generator Quotations
Outside Communication Forms Stock Reports
General Reporting and Storage
Therapist Schedules
Product Catalogues
….
Technical Benefits
Free … did I say that already?
Full Source code, documentation and samples
Seamless integration to Progress 4GL
Single Source for multiple platforms
Simple to implement
Additional feature for end users
Can run as SUPER procedure
Can be implemented in an AppServer
Architecture
Practical Benefits
Eliminate pre-printed forms (cost savings)
Make reports and print-outs more visually
appealing
Include logos, graphics, and fonts
Print Bar Codes
Lower Date-Entry Error Rates
Reduce Labour Costs
Achieve vendor and customer full-packaging-list
acceptance
Job Benefits
Boss can brag about cost savings
You will be super-cool programmer
Add another utility to your list of tools
Drawbacks
No GUI Design Tool (but you can now import pages from
pre-existing PDF documents. So you can create your
template using MS Word then run it through Adobe
Distiller then ‘use it’ in PDFinclude)
Depending on situation .. could be a little slow
Pentium 90 - 2+ minutes
Pentium 4 2.4Ghz – too fast to time
Future
The following offerings have been identified as outstanding issues or
nice-to-have Features. These items are listed in no particular order and will be
addressed – time permitting.
Output Control
pdf_text pdf_set_font
pdf_text_at pdf_text_color
pdf_text_to pdf_text_width
pdf_text_center pdf_set_textRed
pdf_text_align pdf_set_textGreen
pdf_text_xy pdf_set_textBlue
pdf_text_boxed_xy pdf_text_render
pdf_skip pdf_text_rotate
pdf_skipn pdf_get_numfittingchars
pdf_textY pdf_PointSize
pdf_textX pdf_TextRed
pdf_text_char pdf_TextGreen
Pdf_text_charxy pdf_TextBlue
pdf_wrap_text pdf_rgb
pdf_watermark
Graphic Elements
Allows for the positioning and formatting of graphical content
Procedures Functions
pdf_set_fillRed pdf_fillRed
pdf_set_fillGreen pdf_fillGreen
pdf_set_fillBlue pdf_fillBlue
pdf_move_to pdf_GraphicX
pdf_rect
pdf_GraphicY
pdf_circle
pdf_curve
pdf_line
pdf_stroke_color
pdf_stroke_fill
pdf_set_linejoin
pdf_set_dash
pdf_link
External Elements
Allows for the inclusion of external elements into the PDF document.
The External Fonts are used by Text Elements to vary the appearance of
textual content. That is, you could use an external Code39 True Type
Font to display an Invoice Number.
External Images or PDF Pages need only be defined once, but can be
used multiple times.
Procedures Functions
pdf_load_font pdf_Font
pdf_font_diff
pdf_FontType
pdf_load_image
pdf_place_image pdf_ImageDim
pdf_open_pdf (new) GetXMLNodeValue (new)
pdf_use_pdf_page (new)
pdf_load_xml (new)
14 Predefined Fonts
Courier (Oblique, Bold, BoldOblique)
Helvetica (Oblique, Bold, BoldOblique)
Times-Roman
Times (Italic, Bold, BoldItalic)
Symbol
ZapfDingbats
Plus use True Type Fonts with a little up front work. You
will need to create Adobe Font Metrics (AFM) using a
utility program (called ttfpt1.exe .. included in download).
Planes – Defined (1)
Planes are used to define how elements are added to the PDF
document. Textual Content works top-down from upper-left hand
corner while Graphic Content work bottom-up from lower left hand
corner.
0,0 80 792
Textual Content
is measured in Graphic Content
Rows and Cols. is measured in
Points.
Eg: Portrait Page
Is 80 Cols by 65 Eg: Portrait Page
Rows is 612 by 792
65 0,0 612
Planes –Defined (2)
For Textual content, the number of columns and rows will vary
depending on the size of the font you use and whether you use a
fixed or proportional font.
{ pdf_inc.i}
RUN pdf_new_page("Spdf").
RUN pdf_close("Spdf").
Sample Code (1b)
Sample Code (2a)
This sample illustrates how to convert an existing text document to a PDF
document.
DEFINE INPUT PARAMETER p_TextFile AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER p_PDFFile AS CHARACTER NO-UNDO.
{ pdf_inc.i}
3. Matrix
Gallery (1) Fonts Rectangles
Logo
Image
DB
Content
Gallery (2) Logo
Lines
DB
Content
Gallery (3)
XML
Content
Matrix
Tool
Gallery (4)
Logo
Barcode
Font
Watermark
Using an External PDF Page (1)
Create form in Print through Use in
MS Word Adobe Distiller PDFinclude
to generate blank And overlay with
PDF. DB content
Using an External PDF Page (2)
•{ pdf_inc.i "THIS-PROCEDURE"}
Sample Code:
•DEFINE VARIABLE i_Counter AS INTEGER NO-UNDO.
•RUN pdf_open_PDF("Spdf","c:\gord\pdfinclude\samples\support\Invoice.pdf","Inv").
•RUN DoNewPage.
•RUN DoInvoiceInfo.
•RUN pdf_close("Spdf").
•PROCEDURE DoInvoiceInfo:
• RUN pdf_set_font("Spdf","Helvetica",8).
• RUN pdf_text_color("Spdf",1.0,0.0,0.0).
•END.
The following were some of the questions that were asked at
the Michigan PUG held on January 21, 2004.
It's totally arbitrary, but something is required to differentiate each stream. That’s right, you
can have more than one PDF stream per procedure (it’s actually unlimited … unlike Progress
streams).
Does not require Acrobat at all, pdf-inc implements PDF format natively. You do require a PDF
viewer but these are typically free.
Use ghostscript to convert pdf to required format. Ghostscript has a utility called pdf2ps that
converts the PDF output to Postscript which can then be printed on any Postscript printer.
Ghostscript is also a free utility (GPL) available at www.ghostscript.com.
There is a sample program called WinpdfPrint.p available at www.epro-sys.com that illustrates
how to silently print a PDF on Windows.
•How do you direct the pdf streams to different destinations such as email, fax, printer, etc?
You don't direct the streams at all, they are used to create a PDF file that can be sent via
whatever means you like.
Links
https://sourceforge.net/projects/pdf-inc (for Download,
Sample, Documentation, Bug Reporting, Feature
Request, and Donation)
http://www.epro-sys.com (for Creator contact)
http://www.zlib.org (for compression library)
http://partners.adobe.com/asn/acrobat/docs/File_Format
_Specifications/PDFReference.pdf (for Adobe PDF spec)