Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Create a new PDNameTree for named Destinations

Guest
Jan 25, 2017 Jan 25, 2017

A week ago I knew nothing about pdf file internal formats or how to write an adobe plugin, but now I have successfully created a plug in to convert the bookmarks to named destinations and then export these named destinations to a text file.  I have one bug to fix, though, the situation where the destination name tree does not exist.  I could really use some help to finish this off.

Question 1:

So I use the following to get the name tree:

PDNameTree pdNameTree = PDDocGetNameTree(pdDoc, ASAtomFromString("Dests"));

My first issue is how to test for whether this is null.

if (pdNameTree == NULL)

and

if (PDNameTreeEqual(pdNameTree, NULL))

are not acceptable syntax.

So I'm using

if (!PDNameTreeIsValid(pdNameTree))

instead.  Does that seem like an acceptable practice?  Is there any other way to test if a Destinations name tree already exists?

Question 2:

After determining that there is no destinations name tree, how do I create one?  I see the function PDNameTreeNew in the API, but it only takes a single parameter, the pddoc.  How do I then take that newly created PDNameTree and associate it with named destinations ("Dests")?

Thanks in advance for your help!  I'm so close, I can taste it!

TOPICS
Acrobat SDK and JavaScript
453
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 25, 2017 Jan 25, 2017
LATEST

1) ALWAYS use xxxIsValid() APIs when they exist.

2) After doing the PDNameTreeNew(), you will need to use Cos APIs to put it where you want.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines