These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

javascript doesn't work when pages added

itsmikem
Registered: Jul 14 2009
Posts: 44
Answered

Hi list...

I made a one page pdf with lots of javascript that works perfectly. But, when I add one or more pages to it, the functions no longer work. I get "is not defined" errors when calling them, or "has no properties" errors on the links when clicking them. I haven't changed the locations of any of the document scripts.

If I then omit the inserted pages and go back to the document being just that one original page, everything works perfectly again. What am I doing wrong?

thanks,
- Michael M.

scderacjor
Registered: Mar 27 2009
Posts: 123
Are you using the New Page option, or adding previously created (separate) PDF pages?

If you're doing the latter, make sure those PDFs are saved as Dynamic BEFORE adding them into your new PDF. If you're doing the first one, then I have no idea.
itsmikem
Registered: Jul 14 2009
Posts: 44
Thanks for replying, Carly. I got the scripts working. The issue turned out to be not that the added pages wouldn't see the document scripts, but rather, I had a variable calling getLinks() from the page that was the only page but now is the last of many pages, and there was no page number passed as a parameter. When I then passed a param there for the page, it all started to work magically.

- Mike