The RM/COBOL binding for PDFlib, included in the distribution of RM/COBOL, may be used to create highly complex PDF documents through a CALL interface.
Problem:
Modern applications are often required to produce PDF documents, for example as replacements for traditional printed reports or as a standardized mechanism to distribute documents via email. Simple solutions, such as printer drivers or external conversion tools, often lack the ability to control fonts or take advantage of intra-document linking and other advanced features of Portable Document Format (PDF), resulting in PDF documents that fail to meet user expectations for modern ‘look and feel.’ Many solutions also lack the platform portability required by RM/COBOL applications.
Resolution:
RM/COBOL includes a binding for the PDFlib API in the standard RM/COBOL distribution. PDFlib is a product of PDFlib GmbH; more information can be found on the PDFlib GmbH web site (see Related Links at the right for URL). Note that while PDFlib may be evaluated without charge, a license must be obtained from PDFlib GmbH before productive use of PDFlib.
The RM/COBOL distribution includes two example programs which demonstrate many of the features of the PDFlib API. Following the instructions in the file readme.txt in the PDFLib subdirectory, complete the installation of PDFlib and verify the installation by executing the two example programs.
The RM/COBOL program attached to this article demonstrates a ‘before and after’ example for modifying a columnar report with control breaks typical of many COBOL reports to use the PDFlib API, demonstrating some of the PDF enhancements (most notably, bookmarks) that can be added to make ‘typical reports’ easier to use. Note that some of the parameters stored in the CodeWatch control file pdfdemo.cwf may need to be modified to match your configuration.
Disclaimer: The North American Numbering Plan data contained in the data file used for this example is excerpted, is not official and should not be considered useful for any purpose other than providing data for this example. More information about the North American Numbering Plan can be found by using the Related Links at the right.