Implement PDF Splitting for an RTF Template

This section describes how to enable PDF splitting for reports generated from RTF templates.

This section includes the following topics:

Enter the Commands in an RTF Template

When you design a template to use this feature, you must add commands to specify these queries.

  • What element in the data is repeated (using the simple for-each command)

  • How many occurrences of the element are included in each PDF file

  • What information (data elements) to include in the index file

To achieve this, the following two commands must be entered in the template within the for-each loop of the element by which you want the document to split:

  • <?catalog-index-info:name;element_name?>


    name is the name that you choose that is used in the index file to identify the from and to records included in each document.

    element_name is the XML tag name of the element that provides the value for name that you identify above.

    The catalog-index-info command defines the construction of the index file that is created.

  • <?if:position() mod n = 0?><?document-split:?><?end if?>


    n is the number of records you want included per PDF file.

    This command must be placed within the for-each loop of the element being counted. This command instructs Publisher to split the document after the next page break when the number of records equals the n value.

    Each time the document-split is performed, the name-value pairs defined in the catalog-index-info command are written to the index files.

Example - split by each department

This example is based on the XML data given here.

This example is based on the following XML data:



In this example, the output PDF report includes a document for each employee. You want a new PDF file generated for each department. You want the index to list the FIRST_NAME and LAST_NAME from each record that is included in the PDF file.

To achieve this output, enter the following in the template:

<?catalog-index-info:'First Name';FIRST_NAME?>
<?catalog-index-info:'Last Name';LAST_NAME?>
<?end for-each?>
<?end for-each-group?>