Hello,
I'm trying to set page numbers using bookmarks that are already in a PDF document. I am doing this in a javascript action in a batch sequence, with "run commands on" set to "ask when sequence is run."
Here is a snippet (bkm is a bookmark, and startPage is a variable that holds where the numbering should begin):
if ( bkm != null ) {
bkm.execute();
var startPage = this.pageNum;
}
After executing the bookmark, I can see in the debugger that the pageNum property of the current document is not set, so "this.pagenum" gives an InvalidGetError.
If I open the documents in Acrobat, and change the batch sequence "run commands on" to "files open in acrobat" the script works. Why doesn't it work when I choose the files from a file dialog, or preselect a list?
Thanks for any help you may have...
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script