3

I'm trying to create a menu option in Adobe Acrobat that will use JavaScript to parse through a large pdf document and create named destinations using the titles in the document.

The titles all follow the same unique format, so I am able to identify them using regex. Once I identify a title, I also identify the page it's on - and I store both the title and page number in an array.

My plan was to create the named destinations using the information stored in the array. However, I have not had much luck figuring out how to create named destinations with JavaScript.

Any input would be appreciated.

perror
  • 7,071
  • 16
  • 58
  • 85
John McMahon
  • 95
  • 10
  • I don't think this is possible... – yms Aug 07 '15 at 18:16
  • The Acrobat JavaScript documentation refers to ISO 32000 for information about creating named destinations. Therefore, the answer to the question is "No". – Max Wyss Aug 09 '15 at 10:13

1 Answers1

2

Acrobat's JavaScript API does not expose either the name tree nor the destination tree so named destinations in a document can't be created using JavaScript. For further reference here is a link to the Acrobat's JavaScript API.

There is also a C/C++ Acrobat SDK available. It does have the ability to get the name tree and the destination tree for you. If you are willing to use a the C/C++ SDK, it might do the job for you. The API to get the name tree is

PDNameTree PDDocGetNameTree

Here is a link to the C/C++ SDK documentation.

Vel Genov
  • 10,513
  • 2
  • 16
  • 19