BI Publisher PDF Templates

GitHub

Overview

BI Publisher can populate PDF Forms with information from your database. Some of these forms are business or industry related while many of them are official government forms.

BI Publisher enables your system to populate data on the actual PDF form instead of creating and maintaining a separate, custom versions of that form as an RTF template. The savings in time and resources can be enormous.

This also eliminates the need for third party services that do nothing more than take your data and place it on approved government forms. You have this ability in house with BI Publisher.

Documentation

Here are some links to Oracle’s more detailed documentation on PDF Templates and BI Publisher. The Oracle Middleware links have better detail on how to make a PDF template were the PeopleBook link has more information about workflow and special capabilities

Oracle Docs Middleware: PDF Templateshttps://docs.oracle.com/middleware/12212/bip/BIPRD/GUID-602DBD14-E28A-40CC-8355-D44859E4631F.htm#BIPRD2848
PeopleBooks: PDF Templateshttps://docs.oracle.com/cd/F70249_01/pt860pbr1/eng/pt/txml/UsingPDFTemplates-997f8a.html?pli=ul_d2296e56_txml
PDF Templates Documentation

Why Use PDF Templates

Many times, we don’t have the option to change the layout of a report such as in an official government form. Changing the form to suit our business needs would render the form invalid and out of compliance with a published standard. The report would be unacceptable.

Exactly recreating a PDF Form as an RTF document is possible, but time consuming. There are software packages that claim to convert PDFs into Word docs, but, as of this writing, none of them provide perfect facsimiles. They come close, but usually fonts, logos, and boxes are not quite right.

BI Publisher PDF templates allow us to print on the actual published form.

Required Tools

Adobe Acrobat Pro Adobe Acrobat Pro Icon

To create and maintain PDF Templates for Publisher, you will need a licensed copy Adobe Acrobat Pro. This demo uses version 2022.

This is not included with your PeopleSoft implementation.

PDF Template Preparation

Convert to Acrobat 5.0

BI Publisher can use PDFs that are Acrobat Version 5.0 compatible. It cannot use a template with the modern JavaScript, or any other form of automation or security. Additionally, many official PDF forms are locked through security to prevent changes.

The best way to remove all these incompatible features is to print the form using a PDF Printer driver. You probably have one of these already installed in your system. Print the PDF form to a new PDF document saved on your system.

After printing, convert that document to Adobe Acrobat 5.0 for use with BI Publisher.
File > Save As

  • Change the file name to something different as the original file
  • Change “Save as Type” to “Adobe PDF Files, Optimized (*.pdf)
Save as Optimized
  • Click on the “Settings” button at the bottom
PDF 5.0
  • Change the “Make Compatible with:” drop down to “Acrobat 5.0 and later”
  • Click OK
  • Click Save

Your PDF template is now in the correct version for BI Publisher

Remove Unnecessary Form Fields

Once your document is in the correct version, the next thing to do is use the “Prepare form” tool in Adobe Acrobat Pro.

Prepare Form
Prepare form Icon

Adobe will analyze the document and create form fields.

Prepared Form with Data Boxes

Adobe is fairly good at finding all the form fields you need on your document. However, many times there are extra fields in locations that will not be populated or the wrong type of field.


Remove all the fields from the document that you do not plan on mapping in BI Publisher.

Extra Data Boxes removed

Testing PDF Templates

Sample/Test XML File

A valid sample XML File needed to build a PDF template. This file is used for defining box names and template testing.

BI Publisher maps exact matches between XML Tag Names and PDF Box Names. Spending the time creating a good XML source before doing any work on the PDF template pays dividends.

XML Sample File

PeopleSoft BI Publisher Report Definition

Unlike BI Publisher Desktop, Adobe Acrobat Pro does not have a test facility which combines the PDF Template with a sample XML File to test the document.

The best way to test the PDF template in PeopleSoft is with from within the PeopleSoft Application in the BI Publisher Report Definition.

Create a BIP Data source with your sample XML File

Navigate to Home > Reporting Tools > Bi Publisher > Register BIP Data Source.

BIP Data Source

Create a new BI Pub Report Definition for your template

Navigate to Home > Reporting Tools > Bi Publisher > Create BIP Report Definition

Make sure to set the Template Type as PDF

Type PDF

On the “Template” tab, create a basic template entry.

BIP Report Template

Upload your blank document as a base. This will hold the report definition making testing incrementatl templates easier.

To test your PDF Template, you will return to this page and upload your current PDF template.

After uploading, click on the “Preview” button to see the results of your template combined with your sample XML File.

PDF Rendering Note

It’s important to understand how BI Publisher renders data with a PDF template.

Unlike an Excel or RTF template, the data is not inserted into the PDF form, but rather on a layer on top of the PDF form. BI Publisher has no ability to move or alter anything in the PDF template in response to the data.

PDF Data is a layer on top

Attempting to put too large a field on to the template will just result in the report data printed on top of the PDF Document. The result is usually a messy, unprofessional document.

This can be a challenge when gathering requirements from users. They have become used to RTF and Excel type templates that are responsive to the data. If a Government Form only has a small area for comments, BI Publisher cannot make that area larger.

Creating the PDF Template

This assumes the PDF document has been prepared as mentioned above

  • Your XML file structure is finalized.
  • A sample XML File has been created and is available
  • The PDF Document has been reduced to PDF Version 5
  • The PDF Form tool is open
  • Unwanted and incorrect fields have been removed
  • A BI Publisher Data Source and Report Definition has been created in PeopleSoft

Text Boxes

Modify an existing Text Field

Double Click on the target text field for the “Text Field Properties” dialog box

Edit Exiting Text Box

On the “General” tab, change the “Name” field of the Text Field to the source XML field Tag name. The PDF Text Box Field Name must be an exact match to the target XML Tag name.

Map XML Tag to PDF Text Box

On the “Appearance” tab, change the font, size and color if needed.

Appearance Tab

On the “Options” tab, set the alignment and other options. Since this is not a long field, do not check the “Scrolling” checkbox.

Options Tab

Click the close Button at the bottom of the Properties box. The field name on the template now has changed to XML Tag name

Name Box is Mapped

Save the template and test it by uploading it to the BI Publisher Report Template and clicking on the “Preview” button.

Test the Template

Adjust font, size and other properties if needed.

Create a new PDF Form Field

Adding a new field to the PDF template is simple and straightforward.

Click on the “Text Field” control in Acrobat Pro and place the field in the target location on the PDF template.

Copy in the XML Tag name from your sample file to map the data.

New Text Field

Click the “All Properties” link to adjust font, size, and options.


Test your template

Test after adding ID Field

Check Boxes

Open the Check Box control or map a new checkbox control to the form if needed.

Add Check Box

Set the “Name” field on the General tab to the XML Tag name from your file. This maps the specific field in the XML file to this Check Box control.

Click on the “Options” tab on the Check Box Properties

Check Box Options

The Check Box Style dropdown allows you to change the “Checked” box to several different images such as Circle, Cross and Square checks. Choose as per requirements.

The “Export Value” field controls if this box is “Checked” during the report. This creates a Boolean situation: if the value of the mapped field equals this value, the box will be checked. Else, the checkbox will not be checked.

In this example, the mapped field contains Y/N values. However, you can map other values with multiple characters to the box. The box will check only if that exact value is equal to the Export Value.

Test the template

Test Checkbox

Date fields

PDF templates do not have a specific Date field control. Rather Dates are sub-categories of Text fields.

Add your Date field to the PDF template the same as in the Text Box. In the Text Field Properties, map the XML value to this field using the XML tag name.

Add Date Field

On the “Format” tab on the Text Field Properties, change the “Select format Category” dropdown value to “Date”. This opens a dialog box below where you choose the date format.

Select Date Format

Save and test your template.

Test Date Field

Number Fields

Like Date fields, Numeric fields on PDF templates are just Text Boxes with a format category set to “Number”. There is no separate PDF data control for numbers.

Add your number field to the PDF template the same as in the Text Box. In the Text Field Properties, map the XML value to this field using the XML tag name.

Map Number Field

On the “Format” tab on the Text Field Properties, change the “Select format Category” dropdown value to “Number”. This opens a dialog box below where you configure your number display.

Configure Number Format

Save and test your template

Test the Number Field

Long Text Fields

Long Text fields on PDF templates are just Text Fields with a few options selected. PDF templates do not have a specific control for long text.

Add your Long Text field to the PDF template the same as any other Text Box. In the Text Field Properties, map the XML value to this field using the XML tag name.

Add Long Text Field

On the “Options” tab of the Text Field Properties, check both the “Multi-line” and “Scroll Long Text” check boxes.

Long Text Field Options

On the “Appearance” tab, review the font size and adjust accordingly. The default is “auto”, which will attempt to adjust the font size to fit all the data in the box. You can adjust this to a fixed font size, but that can affect how the data will fit into the box.

Long Text Appearance

As a note, there is a limit as to how small the PDF document will display the font. After a certain point, the PDF template will cut off the text at the extent of the box dimensions.

Test the template.

Test Long Field

Making the Video

Making the PDF video for PeopleToolsTechTips Youtube Channel

Randall Groncki

Oracle ACE ♠ PeopleTools Developer since 1996 Lives in Northern Virginia, USA

View all posts by Randall Groncki →