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

Javascript to create bookmark for page that does not exist yet

alan_p
Registered: Jan 18 2011
Posts: 1
Answered

Hello all,

Is there a way to write js for a bookmark that goes to a page that does not currently exist?

For example, I have a 20 page pdf document. We have FileMaker Pro that can 'append' to a PDF additional pages. So when FileMaker pro appends two new pages (bringing us up to 22 pages), I'd like to have 2 'existing' bookmarks in the original 20 page pdf document that will, when clicked, go to page 21 and 22 respectfully.

Is this possible and would anyone have the JS I would put into that bookmark?

Thank you in advance!!

My Product Information:
Acrobat, Windows
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
Accepted Answer
The JavaScript would be:

// Go to page 21
pageNum = 20;


If there are fewer than 21 pages, it will go to the last page. If you want to avoid this, you could do something like:

// Go to page 21 if there are at least 21 pages
if (numPages > 20) pageNum = 20;