How to hide/display a page in a PDF based on a check box

Vivek Gajula picture Vivek Gajula · Sep 18, 2012 · Viewed 9.3k times · Source

I am creating an interactive PDF using Adobe Livecycle. My PDF has 4 pages and the last page is hidden.

I want to be able to display this hidden page based on a check box. Whenever a user selects this checkbox the page has to be visible.

I have used the action builder to change the presence of the last page to visible/hidden based on the checkbox. This was working fine until I added baseProfile="interactiveForms" to the template XML node in the XML Source. I had to add this tag in order to add custom javascript code to to the PDF. Without the interactiveForms attribute the action to hide/display the page works, but I am not able to add the custom javascript that I need to run on the PDF.

Greatly appreciate any help!

Answer

puppetmaster picture puppetmaster · Sep 26, 2012

Use this code on the exit event of the checkbox:

if (this.rawValue == 0){
   xfa.resolveNode("Page4").presence = "hidden";
}else{
   xfa.resolveNode("Page4").presence = "visible";
}