PDF Include

PDFinclude is an open source Progress utility for dynamically generating reports in Adobe PDF file format without having to use third-party tools or utilities.
PDFInclude is a Free Libre Open Source Software (FLOSS), distributed under the Eclipse Public License.
PDFinclude is a stand-alone component that defines a toolset of Progress functions and procedures that aid in the output of a PDF file directly from 4GL/ABL, without having to generate a separate text file first (as in text2pdf.p).


Open Source does not always mean free as in free beer. In order to be able to spend more time on PDFInclude, I need some sponsors. Also, if you wish to see a new or improved functionality, you can offer me a bounty. Lastly if this software is of some use for you and your company, then I'd like to hear from it, and you could consider to donate (via Paypal in USD or Euros). Thanks in advance!


Welcome in the PDF Include group. When you are using PDF Include, you are encouraged to subscribe to this group where you find the on-line tools to collaborate and discuss PDF Include. There is a discussion forum, you can submit issues (for bugs and enhancement requests), you can add new pages and other content, and best of all: there is an e-mail list. So subscribe, and then don't forget to go to your subscription details to enable the e-mail notification!


The PDF file format is an industry-standard for electronic document viewing. The PDF format allows for documents that can be accessed by a broad range of hardware and software devices (including PDAs and Internet browsers).
PDFinclude utilizes Progress code that is compliant with versions 8 and 9 of the Progress 4GL and the same source code can be used on multiple OS platforms - including Windows, AIX, Unixware, Solaris etc. - while running in different application environments (eg: GUI, CHUI, web-enabled and n-tier).


New!

  • 5th of may 2017: a new web site for pdfInclude has been published :)
  • 20th of June 2016: pdfInclude v5.1 is available from me, please contact me using OEHive private messages. All the short comings of the 3.3 version about the pdf parser and filling forms have been corrected, and a lot of new functionality added. See readme.pdf, itself generated using pdfInclude.
  • 16th of January 2011: I finally found the time to publish the last fixes and evolutions! The big news is the support for filling OpenOffice.org generated forms! Acrobat (latest versions were not supported anyway) is not needed anymore in order to create forms to be filled with PDFinclude! Among the other news, you can now rotate text at any angle, skew ans scale text.
  • 2nd of March 2010: The SVN repository has just been updated. This is the very last version of pdfinclude, containing all patches gathered from the PEG, lots of bug fixes, plus new exciting functionalities. Please test before I publish 3.3.4! You can download the last development version.



Main features
• supports international characters (East Europe, Cyrillic, Turkish) for variable width base fonts only (Times and Helvetica). To be published in next version - see SVN version meanwhile. For courier (or if you wish to embed fonts in the pdf file), you can use a font specially defined for the code page as described there.
• supports custom True Type fonts (including Bar Coding fonts), and all 14 pdf base fonts
• supports remapping of characters
• supports ISO page formats A0,A1,A2,A3,A4,A5,A6,B5,LETTER,LEGAL,LEDGER
• supports portrait or landscape, and custom page formats, custom margins…
• supports document encryption (requires procrypt.dll)
• supports compression (requires zlib1.dll)
• includes graphic (geometric) procedures: lines, circles, eclipses, Bézier curves
• includes procedures to set Bookmarks show a Table of Content
• includes procedures for automatic page header and footer management
• include procedure to add watermarks
• supports text rotation
• supports html-ish tagged text for bold , italic and colour
• supports underline
• supports automatic pg line break and text justification
• supports JPEG images (GIF & PNG support in development)
• supports annotations (links, notes, stamps, mark-ups)
• supports rotating text at any angle, skewing and scaling it
• supports loading an Adobe Distiller or OpenOffice PDF generated file to be used as a template (with limitations) – the file might contain images or embedded fonts To be published in next version - see SVN version for images and font support
• supports filling OpenOffice.org generated forms
• supports filling Adobe forms - Adobe version max = 5 ; see previous point...
• tools to create tables, calendars, matrices
• no external libraries are required except for compression and encryption
• comes with a lot of code examples


Downloads
See "attachments" at the bottom of this page for the downloads, including a download of a PowerPoint presentation from the Michigan PUG.
The big .zip download includes a Word document, which is the PDF Include documentation. I've also attached a PDF of that. Thanks Peter Frederick for sending the PDF!
You can always download the last development version from the SVN repository.


Contributions

  • Pro-Sys Consultants are the original authors of PDF Include.
  • jice is the current maintainer. I do it in my free time, so please do not expect too much!

You are welcome to submit patches through the mailing list. After review and discussion, they will be included in next release.
If you have to add functionality and/or modify PDFInclude for your own project, you are encouraged to submit the source code (although it is not required by the license) so that we can all improve the software and bring it to next level.


Also see:
License (Eclipse Public License)
Project page for issue tracking
Forum
Post a new Forum Topic


Last updated
jice 20th of june 2016


Meet us on Google+


Digital signatures and timestamps

Any idea how to expand PDF Include to able to handle digital signatures?
I found sources only for .NET libraries/wrappers, the PDF reference is a little bit unclear for me.
Any idea how to start?


page_rotate

There is a section in the pdf_definition procedure in which the page rotation is hard-coded to zero:

PUT STREAM S_pdf_inc UNFORMATTED
"/Rotate 0" {&pdfSKIP}.

I'm not sure why a page rotation of 0 was hard-coded. This small change makes page rotation work:

PUT STREAM S_pdf_inc UNFORMATTED
"/Rotate " TT_pdf_page.page_rotate {&pdfSKIP}.

Anyone know why this feature was disabled in the first place?


How to prepare the PDF Form file so as fill it with PDFInclude

Good afternoon!

I´m trying to fill a PDF Form with PDFInclude. I've investigated some and I've found that the problem is the PDF Version.

I opened the PDF Sample "sample/support/POForm62.pdf" and saw that the version is a.5 (Acrobat 6.x) but when I use Adobe Acrobat 9.0 to create the PDF Form with the same "Version" this file doesn´t work.

The idea is great... Create a Word Document, print it in PDF Form and later create the PDF Formm so that fill it with PDFInclude... but... It doesn't work!!!

The common errors that I got are:
+ Error Page ID
+ Wrong PDF (PDF created)


Cant use templates created in PDF 9

We are using PDFInclude to take PDF templates with Tags embedded and do a replacement of these at run time to generate populated documents. Until now we have always used PDF 5 to create our templates, but have now been moved to the newer version 9 of PDF. However the templates generated by 9 arent working with Pdf Include.

Are there other products we can use to create the PDF templates? Ive read that OpenOffice can be used, but I cant see in there how I create a Tag in the document.

Thanks


Need OpenEdge on-line certification

Hi,

Is there any on-line certification (free/pay) for OpenEdge any varion?

Thanks,
Sridevi Stalin


Issues with inserting pdf417 image into pdf

We have a character environment and we have for some time used pdf_inc to print shippers as pdf files.  An issue has arisen where we need to insert a pdf417 barcode into the shipper.  The resulting shipper has the barcode in it, but it is not what we expect/need.  It prints three barcodes side-by-side.  Since this is a stacked barcode, I am assuming the conversion is not taking place correctly.  The barcode is being inserted by pdf_inc as an image (jpg).


Using Adobe Acrobat Pro w/ PDFInc

Hi All,

I have used open office to create a document, exported it to pdf and left blank areas where i wish to place 'Form Fields' from adobe acrobat pro. when blank the document works in PDFInc no problem when i add the form fields in then Save As... etc then try and use this document it kicks out an error about the page, see below:

The error returned = "pdf_use_PDF_page Invalid Page # for PDF ID = fs stream = spdf"

Here is the code i have used.

{ pdf_inc.i "THIS-PROCEDURE"}

DEFINE VARIABLE i_Counter AS INTEGER NO-UNDO.

RUN pdf_new ("Spdf","c:\testformfill.pdf").


Encryption of PDF file in Linux

I created an encrypted PDF in windows using
RUN pdf_set_parameter(,”Encrypt”,”TRUE”).
However now I would like to do the same in Linux.
But I will not be able to use procryptlib.dll and md5.exe so what is the alternate.
I tried to do as said in the document
If you are on a *NIX OS then you will need to compile the rc4.c object into a Shared Library
I tried
gcc -o rc4 rc4.c
But it is throwing an error.
rc4.h:33: error: syntax error before "endecrypt"
rc4.h:33: warning: data definition has no type or storage class
rc4.c:133: error: conflicting types for 'endecrypt'


How create a shading rectangle

Is possible create a shading rectangle?

I have a rectangle created with RUN pdf_rect2(...) but i would like that this rectangle has a shading.

Thanks.


UseTags & wrap_text

The wrap text functions don't check if UseTags=TRUE. Doesn't this throws pdf_text_width() and pdf_GetNumFittingChars() calculations off leaving them in?

Stripping the tags, StripBoldItal() + strip color", would return a closer width calculation excluding the bold/italic font width differences. If each word is stripped in the text parameter sent to pdf_text_width() then the original word, including tags, could be appended to the line.


Unique Output Filenames

Problem:
Using PDFextract.p as example; Multiple Users running same program can cause all sessions to APPEND to the same filename.

Line2748:
OUTPUT TO VALUE(SESSION:TEMP-DIR + pID + String(pPage) + ".txt") BINARY NO-MAP NO-CONVERT APPEND.

Patch that fixed problem in our unix environment:

DEF VAR uniqie_id AS CHAR NO-UNDO.
DEF VAR form_uniq AS CHAR NO-UNDO.

ASSIGN
unique_id = ENCODE(STRING(TODAY) + STRING(ETIME) + pFileName)
form_uniq = SESSION:TEMP-DIR + unique_id + "-".

OUTPUT TO VALUE(form_uniq + pID + String(pPage) + ".txt") BINARY NO-MAP NO-CONVERT APPEND.


Overlap

Can PDF include be used for overlapping one pdf document over another?

I have a pdf with an image and a pdf with text and an image. The pdf with text must overlap.

Thnx,
Ingmar.


external PDF created in MS Word

Hi All,

I can import PDF's i have created using PDFinc however the minute i try and use MS word and safe it as a PDF through a PDF converter it does then not allow me to use this PDF. Is it because i am using Word 2007 or perhaps because i havent used adobe distiller. Any help would be great.

The messages i get are:

'Could not load DLL procedure zlib1.dll. (3258)'
'**c:\OpenEdge\WRk\Inv-12-0.txt was not found. (293)'
'**c:\OpenEdge\WRk\Inv-17-0.txt was not found. (293)'
'**c:\OpenEdge\WRk\Inv1.txt was not found. (293)'


Error in ProcessFontDescriptorDictionary

Approximately line 2076 in PDFextract.p ProcessFontDescriptorDictionary:

IF ENTRY(4, text-temp, " ") = "R" THEN DO:
curr-ptr = SEEK(INPUT).

This will error out when text-temp contains less than 4 " " delimited entries.

I changed it to:

IF NUM-ENTRIES(text-temp, " ") > 3
AND ENTRY(4, text-temp, " ") = "R" THEN DO:
curr-ptr = SEEK(INPUT).

Has anyone else run into this or is it something unique to my environment?

TIA.


Using an External PDF Page

I'm following the example "Using an External PDF Page (2)" in the PowerPoint doc.

I've solved some run-time problems. but now the page it creates is blank except for the information I sent to it. It's my understanding it should have created an invoice based on samples\support\invoice.pdf.

Any suggestions/directions are much appreciated.

The resulting PDF is attached.

Here's the code I used:

{PDFinclude/pdf_inc.i "THIS-PROCEDURE"}

DEFINE VARIABLE i_Counter AS INTEGER NO-UNDO.

&scop PDFIdir d:\WDS\CCI\PDFinclude


#
AttachmentSize
PDFinclude.ppt presentation from the Michigan PUG958 KB
PDFinfo.zip6.13 KB
PDFincludeV7-1.0.zip for v721.69 KB
PDFinclude3.3.3.zip for v9+3.06 MB
PDFInclude-PRO-Documentation.pdf600.13 KB
readme.pdf for pdfInclude v5.11.63 MB
Syndicate content