Vous êtes sur la page 1sur 6

Displaying any object on the header/footer of a specific page in Adobe forms

By Namrata Singh, Hitachi Consulting

Business Requirement: Many times, there might be a business requirement to display some specific objects on the footer or header of a specific page when we have multiple pages of output. This article explains how to meet this requirement in Adobe forms. Pre-requisites: Basic Knowledge of adobe forms & its elements with a bit of scripting knowledge is required. Solution: Displaying the header/footer on any specific page is done by creating the header/footer on the master page and writing a small java script to display only on that specific page. The below example shows how to implement the same. Below are two examples Footer at the end of the last page ( Signature or a date) Header at the top of the first page ( Title or a logo)

Note: Displaying on a specific page can be done by changing the logic of the script. Example 1: Footer at the end of the last page (Signature or a date) : Step 1: Create a sub form outside the Content Area in the Master Page. Include the fields in the sub form that has to be displayed at the footer of the page. The content of this sub form will be positioned. Set the size & location of the sub form exactly where you want the footer to get displayed.

Step 2: Go to Palettes->Script editor.

Step 3: Click on the created sub form and write the below script in the script editor. The below script is to display the footer only at the end of the last page. If you dont write the script the footer will be printed on all pages. Write this in the: Event: Initialize Language: FormCalc Run at: Client var curp = $layout.page ( ref ( $ ) ) var totalp = $layout.pageCount() if ( curp ne totalp ) then $.presence = "hidden" endif

Save and activate these changes. The output is as below with the footer at the end of the last page. Page 1 :

Page 2 :

Click here to continue...

Displaying any object on the header/footer of a specific page in Adobe forms


...Previous

Example 2: Header at the top of the first page (Title or a logo) Here, we would be displaying the title only on the first page. Displaying the header only on the first page will require a small change in the java script and placing the header at the location where you would like to display. Step 1: Create a title outside the content area of the master page. Set the size & location of the title and form exactly where you want the footer to get displayed.

Step 2: Go to Palettes->Script editor. Write the below script in event initialize and language FormCalc

This script would display the header only on the first page. Likewise, we can display it on any specific page by simply changing the value of variable curpage var curpage = $layout.page ( ref ( $ ) ) if ( curpage ne 1 ) then $.presence = "hidden" endif

Save and activate these changes. The output is as below with title only on first page. Page 1:

Page 2:

Vous aimerez peut-être aussi