Hi all,
Only just found this forum and was hoping someone could help me with a problem I have been struggling with for some months (but keep putting off).
I have a LiveCycle form which has a data connection whose schema is something like: There can be any number of 'client' nodes in the XML and a client can have either 9, 12 or 15 'slot' nodes.
The pdf is setup so that there is 1 client per page with the slots repeating in a flowed subform. At the moment we are only allowing 12 slots per client and this is working fine - everything is laid out as required but the time has come to allow 9 and 15 slots but to 'space' out the slots on the page.
My question is, at 'compile' time is it possible to to run a script on every page that sets the height of every 'slot' subform on that page to a certain value. The quasi-code would look like this:
on pageReady
for each 'slot' subform
if numberOfSlots for this client = 9 then height of 'slot' subform = x
if numberOfSlots for this client = 12 then height of 'slot' subform = y
if numberOfSlots for this client = 15 then height of 'slot' subform = z
next
end
When I last tried to do this (many weeks ago), the function would resize the first instance of the 'slot' subform but none of the others.
Is what I am trying to do possible ? And if so, could someone point me in the right direction of how to do it ?
TIA for any help.
Regards,
Adam Brunt
If you want to affect the height of all of the repeated subforms you have to explicitly set the height of each one. There are two approachs to this.
1. From a script in an element above the repeatable subforms use the resolveNodes function to find all instances. And then loop through them to set the height.
2. Form a script on the repeated subform the hieght change can be applied directly to "this"
You might want to watch this video on scripting subforms:
https://admin.adobe.acrobat.com/_a200985228/p87746471/
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script