Skip to main content
January 18, 2017
Answered

How to extract the list of named destinations

  • January 18, 2017
  • 1 reply
  • 6068 views

My team produces a software product with PDF help.  We create the PDF help in InDesign and use javascript to create automatic named destinations from the table of contents to be able to open the pdf help to specific locations from our program.

For some reason, InDesign attaches some random digits to the end of all of our named destinations.  They are not visible in the named destination list in InDesign, but when you export the pdf, they appear.  From what I can gather online, this is a new problem introduced in Creative Cloud 6 but I don't see any responses from Adobe regarding them acknowledging or fixing this problem.  Can you please address this?

As a work around, my team would like to deal with these random digits by extracting the list of named destinations from the pdf so we can link to them appropriately.  I see this question asked many times with no actual answers/help provided.  They say "use the sdk; it has examples."

I downloaded the SDK and have been going through the documentation and there are no examples for this.  It's very confusing because the documentation describes the file trailer and document catalog and name trees but the actual Acrobat TLB does not seem to have corresponding parameters/functions to access these.

Please, please, please, can someone from adobe provide some help in how to extract the named destinations?  This is a very big issue for my team and I think many other individuals.

This topic has been closed for replies.
Correct answer Test Screen Name

The full PDF structure is only available to plugins, in C/C++, which can use the Cos later to examine specific objects. Though a PDNameTree API might be more simple for the named destinations. The other APIs only offer packaged access to a tiny fraction of the PDF content; and the ability to write does not mean there's an ability to read.

1 reply

Test Screen NameCorrect answer
Legend
January 18, 2017

The full PDF structure is only available to plugins, in C/C++, which can use the Cos later to examine specific objects. Though a PDNameTree API might be more simple for the named destinations. The other APIs only offer packaged access to a tiny fraction of the PDF content; and the ability to write does not mean there's an ability to read.

lrosenth
Adobe Employee
Adobe Employee
January 18, 2017

As TSN says, you will need to write a plugin in C/C++ to get this info and the PDNameTree APIs (along with some Cos APIs) will achieve your goals.

Karl Heinz  Kremer
Community Expert
Community Expert
January 19, 2017

Thank you both for confirming that for me!  I was told by another developer that it was possible to do this without writing a plug in.  So at least now I'm headed in the right direction.  If I have to write a plug in anyway, I should probably just write a plug in to convert the bookmarks to named destinations and not do that step inside InDesign. 

Anyhow, I'm currently going through http://help.adobe.com/livedocs/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Acrobat9_HTMLHelp&file=Plugins_Introduction.31.1.html and have downloaded the SDK.  I see there are a lot of examples there, but it has been a very long time since I have used Visual Studio or C++.  Could you please tell me if my understanding of this process below is correct?

1.  In the SDK, I should install Acrobat XI SDK\PluginSupport\Tools\Visual Studio App Wizard\setup.exe which will install the right tool into Visual Studio for me to be able to write an adobe plugin?  (After I install, will something like "adobe plug in" show up in my options for a new project?)

2.  After thoroughly understanding the helpdocs above, I should use the sample code provided, like Basic Plugin, and try to create a .api file in Visual Studio.

3.  I should put the BasicPlugin.api file in the Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\plug_ins directory and then open up any pdf file.  The plug in will automatically load when acrobat launches?

4.  Assuming that all of this works properly, then I should be ready to write my own code for my named destination issue by modifying sample code provided in the sdk?

Thank you for your help with this.


You are correct with 2, 3, and 4. As far as #1 goes: You don't need the the App Wizard (it's not available for the Mac for example, and we can still build plug-ins on the Mac), but it makes things a bit more convenient. For a large project I worked on a while ago, I even created a new plug-in wizard that created plug-in templates with a lot of modifications that were required for that project. But again, you don't really need it - you can just copy and modify one of the existing sample plug-ins to start a new project.

You should start with the basic or the starter plug-in, understand what it does, and then modify that so that you - step by step - explore the plug-in API. Once you know how to compile plug-ins, and are ready to look at the more complex aspects of working with the plug-in API, you should compile and install the Snippet Runner, which allows you to look at a lot of sample code for different areas in the plug-in API.

Working with the plug-in API requires that you have a good understanding of the PDF format as well. You may also want to take a look at Leonard Rosenthal's book: Developing with PDF: Dive Into the Portable Document Format: Leonard Rosenthol: 9781449327910: Amazon.com: Books