cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Adobe Forms:Page hide/visible dynamically

ahamed_kaleem
Discoverer
0 Likes
2,996

Hi Guys.I have an urgent requirement.Pls help on this.I need to hide/visible a page dynamically based on the text content inside the page is blank or not..I have wrapped the page into the subform,then in the initialize event i wrote the below code,

if(data.pagename.fieldname.rawValue===''"")

{

data.subformname.presence="hidden"

}

it is not working.

The dynamic & fillable flag is also set in the form parameters.

i tried with formready and docready event also ,it is not working.

Please suggest any solutions..

Accepted Solutions (0)

Answers (1)

Answers (1)

PascalBremer
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Ahamed,
at first it is important to note the difference between static and dynamic pdfs.

1. Static
Are rendered by the ADS, this means that the scripting (server + client) are executed by ADS before outputting the pdf

2. Dynamic
They are only supported by Adobe Reader. The scripting is executed by the Adobe Reader when opening the PDF.

Please at first check if you really need dynamic pdfs, because it limits the end-user to adobe reader only.

Now for the question at hand.
In your initialization script of the page, you can access the data bound to a page via this.dataNode:

if (this.dataNode.id.value === "bk102") {
	this.presence = "hidden"
}

In my example attached to this answer, I use the microsoft sample xml data set (https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms762271(v%3Dvs.85))

Each page is bound to one book node. If a page contains the book with the id bk102, it is hidden from the final output. Of course you need to change the scripting according to your data.

Instead of accessing the data node directly you could also bind the data to a hidden field and just read the value from this field in the scripting.

IMPORTANT!!!
I was unable to attach the designer files directly to this answer, so please go to this github gist and press download zip on the top toolbar: https://gist.github.com/Bomberus/d71419286e977e49bf13c13cc93be283