Pagetec
Home     Products & Solutions     About Pagetec     Contact Us  
afp to pdf
 
Go To Printer Friendly Version
 
Input | Bookmarks | File Splitting | Stylesheet | Miscellaneous


 

Introduction

The AFP-VIEW program transforms AFP files (MO:DCA format) to PDF output, for viewing using Adobe's Acrobat Reader.

The AFP-VIEW program is controlled by a user-written stylesheet that consists of simple commands that can be written by non-programmers.

The AFP-View program uses the VERSACOMP composition engine, a high-quality composition and pagination program, to produce the PDF output.

Input Files

The AFP-VIEW input files consist of the following:

AFP Document File
The AFP Document File is the file, coded in IBM's MO:DCA format (Mixed Object Document Content Architecture) that is to be converted to PDF output. AFP-VIEW processes all applicable MO:DCA objects contained in the AFP Document File, including the following:

  • Document Structure Objects


  • Resource Objects

    • Font Objects
    • Overlay Objects
    • Page Segment Objects

  • Graphics Objects

    • IM Image Objects
    • Image Objects (IOCA)
    • Graphics Objects (GOCA)

  • Text Objects


  • Bar Code Objects


  • Object Containers


AFP Resource File (optional)
If the required AFP resources are not contained in the AFP Document File, they can be provided to AFP-VIEW in this separate input file.

AFP-VIEW Stylesheet
This input file contains the AFP-VIEW stylesheet which consists of job control commands.

Output Files

The output files generated by AFP-View consist of the following:

  • PDF file for the document. If PDF file splitting (see below) is not selected, only one PDF file will be generated. Otherwise, multiple PDF files will be generated.


  • PostScript file for the document, if the PostScript option is selected. AFP-VIEW can generate PDF output, or PostScript output, or both PDF and PostScript output concurrently.


  • A list containing the bookmark text strings and their level numbers, for all bookmarks generated by AFP-VIEW.


  • A list containing the names of the PDF files generated by AFP-VIEW.


  • User-defined extract file (indexes, etc.) consisting of data extracted during the PDF page generation process. A maximum of eight (8) such extract files may be used.

Bookmark Generation

The bookmark generation facility provides for placing PDF bookmarks in the PDF output file. Such bookmarks are used by Adobe's Acrobat Reader to display an outline of the PDF file, and to provide instant access to the document pages represented by the bookmarks.

Up to 9 levels of bookmarks may be used in a document.

Bookmarks with their associated text are generated using script commands in the stylesheet. The script commands provide for extracting text strings from the text contained in the AFP pages. Bookmark data may be collected from multiple text strings on a page, and may be concatenated with literal constants to create any desired bookmark text.

File-Splitting Facility

The file-splitting facility provides for the generation of multiple PDF files for an AFP Document File, as an option to the normal process of generating a single PDF file. The use of file splitting can be desirable for a variety of reasons. For example, it can be used to generate a separate PDF file for each customer account in a file of customer financial statements.

File splitting is controlled by script commands in the stylesheet. Script commands are used to perform two file splitting functions:

  • Determine where within the Document Input File that file splitting is to be performed. This determination can be made by looking for unique text strings on each page of AFP data, such as a customer account number, or a customer name. It can also be determined by testing the page name contained in the AFP Begin Page object.


  • Generate the name of the PDF file. The name of the PDF file can be generated from data picked up from the page of AFP data, such as a customer account number.

    PDF file names can also be automatically generated by AFP-VIEW by incrementing the numeric portion of the PDF file name defined for the initial PDF file name specified for the document.

PDF file names can be any length acceptable to the computer operating system being used.

External Overlays

External overlays are page overlays that are distinct from the page overlays that are part of the AFP Document File.

External overlays may be used for the following:

  • In conjunction with AFP overlays, when an AFP page overlay is not available.


  • As the sole source of page overlays, when the AFP page overlays are not available.


  • As a replacement for a page overlay present in the AFP Document File.

External overlays may consist of the following items:

  • PDF pages, containing any combination of text and graphics. Such PDF pages may be generated using any common software that is capable of producing PDF output.


  • TIFF Images


  • JPEG images

Multiple External Overlays may be placed on a single PDF page generated by AFP-VIEW. A maximum of 5,000 External Overlays may be used for a single AFP Document File.

StyleSheet

The AFP-VIEW stylesheet provides the job control information for the AFP to PDF transformation process. It consists of a family of easy to understand commands that are coded by the user, using any standard text editor (ASCII or EBCDIC).

A stylesheet has two parts - Descriptors and Procedures.

DESCRIPTORS

The following is a brief description of the AFP-VIEW descriptors that may be used in a stylesheet. All descriptors, except for the AFP Font Descriptor, and PDF Font Descriptor are optional.

AFP Font Descriptor
This descriptor defines an AFP font that is referenced in the AFP Document File. An AFP font name consists of three parts: Coded Font Name, Coded Page Name, and Character Set Name. The descriptor also defines the reference number of the PDF Font Descriptor for the PDF font to be used for the AFP font. A separate AFP Font Descriptor must be present for each unique AFP font in the AFP document File.

PDF Font Descriptor
This descriptor defines a PDF font to be used for generating PDF output. The descriptor includes: the reference number used in the AFP Font Descriptor, the PDF typeface number, font pointsize, font setwidth, and word space size.

PDF File-Splitting Descriptor
This descriptor defines the AFP-VIEW file-splitting facility, whereby the AFP Document File is divided into multiple PDF output files. The descriptor specifies the name of the Procedure to be executed for determining when file splitting is to take place, and for building the name to be assigned to the PDF file.

PDF Bookmark Descriptor
This descriptor defines the characteristics of a bookmark to be placed in the PDF output file. The characteristics include: bookmark level (1-9), PDF display mode, and the name of the Procedure to be executed for the generation of the bookmark text.

PDF DOCINFO Descriptor
This descriptor defines the PDF DOCINFO data to be attached to the PDF output file. This data includes: document title, subject, author, and keywords.

PDF Open-Action Descriptor
This descriptor defines how the first page of a PDF file is to be displayed when the file is opened by Adobe's Acrobat Reader.

PDF Display Descriptor
This descriptor defines the display characteristics to be invoked for bookmarked material. Five different display modes are provided.

PDF Background Color Descriptor
This descriptor defines a color to be applied as a background color for all PDF pages, to improve readability.

Overlay Descriptor
This descriptor defines an External Overlay to be used. It assigns a reference number to the overlay, specifies the name of the overlay file, and specifies the horizontal and vertical offsets to be used when placing the overlay on a page.

Translate Descriptor
This descriptor defines a translation table to be used for translating non-standard text in the AFP Document File.

Replace AFP Object Descriptor
This descriptor defines the graphics replacement operation to be performed, when an AFP graphics object is to be replaced by an AFP-VIEW External Overlay. The descriptor specifies the AFP object class, the AFP object name, and the reference number of the Overlay Descriptor for the replacement item.

Cutout Page Material Descriptor
This descriptor defines the cutout operation to be performed, when textual matter on an AFP page is to be ignored when generating the corresponding PDF page. The descriptor specifies the X-Y coordinates of the beginning and end of the cutout area.

Suppress-Page Descriptor
This descriptor is used to suppress the placement of certain AFP pages in the PDF output file. AFP pages that may be desirable to suppress include: AFP Document File banner and trailer pages, and blank pages that may occur throughout the AFP Document File.

Debug Descriptor
This descriptor is used during the job setup testing phase. It allows you to limit the number of PDF pages generated during a test run, to a specified block of sequential pages, for example, pages 1-10, or pages 500-525.

PROCEDURES

The Procedures section of the stylesheet consists of a series of PROC Command Blocks that are used to manipulate text strings on pages within an AFP Document File. In general, Procedures are used primarily to control bookmark generation, and PDF file-splitting operations.

Procedures consist of easy-to-use script commands that can be used to find, test, save, extract, modify, and concatenate text strings. Script commands are also provided to perform basic arithmetic operations.

The script commands provide a powerful facility for handling a wide range of data manipulation functions.

Ancillary Output Files

AFP-VIEW generates two optional output files that can be used during the job setup phase. Both files are text files that can be viewed using a standard text editor. AFP-VIEW provides an option to limit the number of PDF pages to be generated for a job setup run.

Text Parameter File
If selected, the Text Parameter File is generated during the normal composition and pagination of the PDF pages. This file contains the following information for every page in the PDF output file:

  • Sequential page number.


  • Every text string that appears on the page. Text strings are sorted by the page Y and X coordinates.


  • The Y and X coordinates for each text string.


  • The full AFP font name for each text string.


  • The PDF font number assigned to each text string, along with all of the font size parameters.

In practice, the Text Parameter File is used to adjust the PDF font parameters defined in the stylesheet. If you find a text string in the PDF output that does not match the corresponding text string in the AFP output page, you can quickly locate that text string within the Text Parameter File, see what font parameters were used, and identify the PDF Font Descriptor that needs to be adjusted.

Raw Text File
If selected, the Raw Text File is generated during the normal composition and pagination of the PDF pages. This file contains the raw text (text without AFP command data) for every page in the PDF output file. For each page:

  • The page is identified by a sequential page number.


  • The text strings are sorted by Y and X coordinates, from the top of the page downward.


  • Text strings that have the same Y-coordinate are positioned on the same line in the file.


  • Individual text strings on a line are separated by two spaces.


  • Each line of text is assigned a line sequence number, which starts at '1' for each page.

The Raw Text file is used in conjunction with AFP-VIEW script commands in the stylesheet, for data manipulation purposes, such as, building bookmarks, and generating PDF output file names. The script commands reference raw text by their assigned line numbers, and can also reference parts of a line of text.

During the normal production run, AFP-VIEW also generates a raw text image while composing each page, for internal use by the script commands executed for the page.

Support Programs

The AFP-VIEW system includes a family of support programs that perform special functions related to the AFP to PDF transformation process. These programs include the following:

AFP Object-Count Program
This program scans the entire AFP Document File, and counts the number of occurrences of the primary AFP objects.

The output from this program consists of a printable one-page listing containing the names of the objects counted, and the number of occurrences for each object.

This listing provides a good review of the contents of the AFP Document File.

Font Descriptor Generation Program
This program scans the entire AFP Document File, and extracts all of the AFP font references contained in the AFP objects: Map Coded Fonts Format 1, and Map Coded Fonts Format 2.

The resulting list of three-part AFP font names is processed to eliminate duplicates and sorted.

Then, an AFP Font Descriptor is generated for each entry in the font list described above. In addition, a reference number for the related PDF Font Descriptor is appended to the AFP Font Descriptor.

Next, a PDF Font Descriptor is generated for each AFP Font descriptor. If the AFP font names follow standard IBM AFP font naming conventions, the program will generate PDF Font Descriptors having the proper typeface, pointsize, and setwidth values. Otherwise, the program generates default values for the PDF Font Descriptors, and the user will have to adjust these values.

The output from this program is a text file containing all of the required Font Descriptors for the job's stylesheet.

Font Descriptor Test Program
This program is used to validate the AFP Font Descriptors, to ensure that the proper font families, font faces, and font sizes have been specified. It provides the means to limit the number of PDF pages that have to be manually compared to the AFP original pages, when checking for proper PDF font selection.

The program operates in the same fashion as AFP-VIEW, except that it does not place in the PDF file every page that it generates.

Instead, the program places in the PDF output file only those pages that references a font not referenced in the previous pages.

For example, assume that the AFP Document File uses 10 fonts. If pages 1-5 contain 8 of the 10 fonts, page 100 contains the ninth font, and page 500 contains the tenth font, then the PDF output file will contain pages 1-5, 100, and 500 only.

Special Features

The AFP-VIEW program has been written in a high-level programming language (VERSACOMP) making it easily modifiable to accommodate special features that you might require.

Simply provide us with a description of your special requirements, and we will work with you to add the required features to the program.

Hardware Platforms

APF-VIEW is available to be run on the following platforms:

  • Intel compatible PC (Windows-98 or higher)


  • IBM Mainframe (OS/390 family)