Skip to Content

Introduction:-

Adobe Forms are PDF (Portable Document Format) documents containing data from various core systems represented in a
well-known structuring method for data output. Adobe forms can be both static as well as interactive and can be printed, distributed via email and saved locally.

The reasons behind using Adobe Forms are it provides security options like digital signatures, disabling print option and the major reason is PDF document is an open standard.

TYPES:-

1) Interactive Forms: – Interactive Forms are PDF documents that require forms to be filled by the users which can be either done
online or offline and the data entered can be used for further processing. Thus interactive forms can be classified into two types:-

  1. Online:-Here the user displays and fills the form via WebDynpro which can be accessed via a portal or web Application Server.
  2. Offline:-Here the user downloads and saves the form in local hard drive for filling it up later and uploading the completed one

                  back to the server. 

2) PDF-Based Print Forms:-The PDF-based Print forms are similar to SMARTFORMS used to print Invoices, salary, etc. They are static in nature as there is no user interaction.   Now in this document we will learn how to use Dynamic fonts in a single Adobe Forms. 

Prerequisites of using fonts in Adobe Forms:-

  1. The font to be used should be installed in the system where the Adobe Form is developed and also in the system where it is viewed.
  2. ADS (Adobe Document Services) require access to fonts that are installed in thefont manager module. So the new font to be used has to be placed in the font manager module of the ADS.

Steps to be followed to use multiple font using java script:-

1.Go to the TCODE SFP to open the adobe form.

          /wp-content/uploads/2013/12/1_341629.jpg

             

2. Go to the interface and add the following field of string type. Here wf_font will hold the font type that is to be used in the form.

            /wp-content/uploads/2013/12/2_341645.jpg

3. In the context of the form add the field wf_font from the interface.

            /wp-content/uploads/2013/12/3_341646.jpg

  4. Go to the form layout and add normal text field from the object library to the main page and design view for holding the value of the field wf_font. Ensure that you have the field as invisible (presence in object properties).

              /wp-content/uploads/2013/12/4_341647.jpg

                WF_FONT field in Master Page.

            /wp-content/uploads/2013/12/5_341648.jpg

              WF_Font in the design view.

    5.Now the most important part is writing the JAVA SCRIPT to change the font at each and every element. We will write the JAVA                SCRIPT at the initialize event. The script we are going to write is “this.font.typeface = “NAME OF THE FONT”.

       

      The “this” in the above script refers to the specific field (wf_vblen,wf_mat,etc).Now we are sending the font dynamically from      the print program and we have the same in the field wf_font of the form.

     

      So the required JAVA SCRIPT will be:-

         

      this.font.typeface = xfa.resolveNode(“data.#pageSet[0].Page1.WF_FONT”).rawValue;

       

      Where xfa.resolveNode () evaluates the specified reference syntax expression and returns the value of the object specified in      the reference syntax expression.

     

      As a result we will get the value (like ‘Times New Roman’, Etc.) we have passed from the print program and the same is assigned to      the font of the element in the form layout.

 

      The same script is to be placed at all the elements in the layout.

      /wp-content/uploads/2013/12/6_341649.jpg

        JAVA SCRIPT at one node in the master page.

        /wp-content/uploads/2013/12/7_341650.jpg

        JAVA SCRIPT at one node in the Design View.

         

NOTE: – We are using a different field in design view as the value of the field in the master page can’t be accessed in the design view.

Changes in code:-

Apart from the normal logic to fetch and display data in the adobe form we need to pass the font name to the form interface.

  /wp-content/uploads/2013/12/8_341652.jpg

      /wp-content/uploads/2013/12/9_341653.jpg

Here when you right click and check the document properties you can see the fonts. That is CorpoS (corporateS).

     

        /wp-content/uploads/2013/12/10_341654.jpg

          /wp-content/uploads/2013/12/11_341655.jpg

        Same for using the font “Times New Roman”.

Problem Areas of using Dynamic font:-

  Using dynamic fonts in Adobe Forms has some restriction. Few are discussed below:-

 

  • We can use the JAVA SCRIPTS only for fields that we send value from print program and not hard coded text. So all the hard coded text has to replaced by the text fields.
  • In Adobe Form we have the default Page no. and we don’t have to place any logic for that. But the same is hard coded text( page ). So we have to replace that with a text field and place the below java script to ensure we get the page no. in different fonts.

      /wp-content/uploads/2013/12/12_341660.jpg

  • Another issue that we face is when we use fonts with a bigger size. As a result the text field behaves only with the original assigned font and not the dynamically assigned font thus resulting in overflowed or truncated text.

The print program code is attached.

     

                 

To report this post you need to login first.

3 Comments

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

  1. Gideon van Zyl

    Thanks, Sambeet, I implemented the solution and it worked really nicely. Just important for other people to know that you need to use a “Text Field” type field and not a “Text” type field which is converted to a floating field, otherwise it won’t work  🙂

    (0) 

Leave a Reply