Hi
I have made a large document to make my work easier.
The document consists of over 100 pages with many fields. When I created the document I named EVERY field to ItemX (X=pagenumber). Like this: Item1 (for page 1), Item2 (for page 2), Item97 (for page 97). As you can imagine, it took a while to go through all 100 pages and rename all the variables for each page.
Is there an easier way to do this?
If I have like 100 copies of exact same page, with same fields as all the other pages. Is it possible to set a specific field on a specific page to a value? Instead of naming every field to PageXItemY?
Like this:
this.page78.getField("Item").value = event.value
Is it possible?
Thanks in advance
(I hope my english isnt to bad to understand)
Niclas from Sweden
Another best practice is to give the fields meaningful names, to that when your are referencing the fields in code, or from some external application you can make sense of them.
Naming fields is long and tedious and unfortunately JavaScript cannot be used to directly rename a file. But since you are repeating the same page many times there is something you can do. You can use page templates. Look up page templates in the Acrobat Help and in the Acrobat JavaScript Reference.
All you do is turn the page into a template, and then run some code from the console window to spawn new pages with different field names. This can only be done on Acrobat Standard and Pro. So this is somthing that only you can do to setup your form.
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]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script