*TEMPLATE (PRTPAGE)


PLBCMP GUI Only, 9.6B

*TEMPLATE={string}

 

This advanced print control allows a page from a secondary PDF file to be included as a PDF object in the current page being generated for PDF output. This control allows a template page to be combined with PL/B program data to be generated into a single PDF output file. The template page used from the secondary PDF is not presented in the Print Preview.

 

This advanced print control takes a comma separated list of fields as provided in the <string> data string. Each field is composed of a field identifier assigned using a '=' character followed by field data. The data <string> field data can be specified with or without double quote characters.

 

The following *TEMPLATE fields are supported:

Where:

<string>
A user specified string that may or may not include double quote characters.

Fields:

F=<string> //Required
Specifies the file name of an existing template PDF file from which a PDF page is extracted and included as a PDF object in the current PDF page output being generated.
G //Optional
This command causes the template pdf pages and resources to be generically extracted without knowing the PDF object syntax structures.
P=<string> //Optional Page
This command specifies the page number to be retrieved from the template PDF file and included into the current PDF output file page as a PDF object.

Notes:

 

  1. The *TEMPLATE control is implemented to extract PDF pages and objects from a Sunbelt PDF formatted document. If a PL/B application creates a Sunbelt PDF document, this Sunbelt PDF document can be used as the template PDF document referenced by the *TEMPLATE control. A Sunbelt template PDF document has the following requirements:

  2.  

    Generate/bullet1.gif    The template PDF cannot have more than five hundred (500) objects where the objects are determined as follows:
     

    Count

    Object Type

    1

    Each Unique image

    1

    Each Unique font

    2

    Each page in the PDF document

     

    Generate/bullet1.gif    PDF encryption is not allowed.

     

    Generate/bullet1.gif    PDF compression is not allowed.

     

    Generate/bullet1.gif    A maximum of 20 images per page are allowed.

     

    Generate/bullet1.gif    A maximum of 20 fonts per page are allowed.

     

  3. If a 3rd party PDF document meets the criteria as outlined for a Sunbelt PDF template document, it might work with the *TEMPLATE control if basic PDF objects and formats are being used.

  4. The default behavior when using a 3rd party PDF document as a template is that it must meet the criteria as outlined for a Sunbelt PDF template document. It might work with the *TEMPLATE control if basic PDF objects and formats are being used in the third party PDF template. However, if the 'G' command is specified in the *TEMPLATE command {string}, the third party PDF template is processed to extract the PDF objects and resources without knowing the PDF object syntax structures. The 'G' command can be used to improve the ability to use more complex 3rd party PDF templates.

  5. When the *Template control embeds PDF page objects into the current PDF output file, the PDF page objects are optimizes to re-use the first page object multiple times as needed. The PDF page object optimization helps to reduce the size of a PDF document the includes the multiple page objects.

Example:

 

PF PFILE

.

         PRTOPEN PF,"pdf:","temptest.pdf"

....

. This next PRTPAGE creates a PDF page object from the third page of a PDF file named 'secondary.pdf'.

. This newly created PDF page object is stored as a PDF object into the current PDF file named 'temptest.pdf'.

.

         PRTPAGE PF;*TEMPLATE="F=secondary.pdf,P=3";

.

.Continue with current PRTPAGE operations.

.

         PRTPAGE PF;*P5:20,"Test..."

....

. This next PRTPAGE causes a page to be removed from a template

. using a generic extraction technique where PDF object commands and formats are not known.

.

         PRTPAGE PF;*TEMPLATE="F=secondary.pdf,P=4,G"

 

 

See Also: List Controls (PRTPAGE), PRTPAGE

 



PL/B Language Reference *TAB (PRTPAGE) *ULOFF (PRTPAGE)