Expand my Community achievements bar.

Defining print properties for a Livecycle form

Avatar

Level 3

Hi,

I am working on a form in Livecycle Designer ES2. The form is basically a checklist that has a series of questions and based on the answers to each question, I have made it so that hidden fields will become visible when necessary. The problem I have is that if someone tries to print the form and intends to fill it out as a printed document, then the hidden fields will not show because the necessary actions to reveal them have not happened. I tried creating an action so that when the form is about to be printed, all fields become visible but that defeats the purpose of printing out a form that WAS filled out electronically. Is there any way to create an action so that when the form is printed AND all/most fields are empty, then the necessary fields are set to visible?

I really appreciate the help. Thanks very much.

1 Reply

Avatar

Level 5

Hi,

I think this will helps you.

Copy the following script to the click-event of the Print-button:

for(var i = 0; i < xfa.host.numPages; i++)

{

    var oFields = xfa.layout.pageContent(i, "field");

    var nodesLength = oFields.length;           

    for(var j = 0; j < nodesLength; j++)

    {

        oFields.item(j).presence = "visible";

    }

}

xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);

This script take a look to all pages to all fields and make them visible.

Kind regards Mandy