Skip to Content

Business Requirement:


Many a 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.


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

  1. Footer at the end of the last page ( Signature or a date)
  2. 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.

           1.JPG

Step 2: Go to Palettes->Script editor.

            2.JPG

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 don’t 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 

               3.JPG

                  Save and activate these changes.

                 

                 The output is as below with the footer at the end of the last page.

                      

                 Page 1 :

                 4.JPG

                Page 2:

                    5.JPG

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.

            6.JPG

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 

             7.JPG

               Save and activate these changes.

               The output is as below with title only on first page.

              

               Page 1:

              

               8.JPG

             Page 2 :

                 

                  9.JPG

                


       

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply