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

Bookmarks dropping after Combine Files

New Here ,
Jan 22, 2020 Jan 22, 2020

Copy link to clipboard

Copied

I have written a Javascript process that searches a template and grabs the text in the title block (by cursor coordinates). The script then uses the text it finds, does a bit of judo and then creates a standardized text string that is then built into a bookmark using the following bit of code:

.....

//Extra function to deal with hyphens
var theTitle = prepareTitle(list)
var root = this.bookmarkRoot;
try {
       // If <a> is returning nothing interesting, then call it an odd template
       // Highlight it and make sure it gets coded properly
       if (typeof a=='undefined'){
           root.createChild('***NOT A STANDARD TEMPLATE***', "this.pageNum=" + p, p);
       }

       else{
            root.createChild(theTitle, "this.pageNum=" + p, p);
       }
   }

catch (e) {
    app.alert("Processing error: " + e)
    }
....

This process works perfectly, and the bookmarks link to exactly where I intended them to go. The breakdown however, occurs when combining the output with other PDFs. The bookmarks of the other PDFs work properly and appear correct. On this one, the bookmarks are all lost. It seems that if I right click on each individual bookmark and click "Set Destination" the combine is successful. Otherwise, all hope is lost. Is there a way to set these bookmarks (using Javascript) so these bookmarks persist? The right click... etc. is not the best solution when we are working with reports with hundreds of figures. 

 

Thanks for any help!

 

TOPICS
Acrobat SDK and JavaScript

Views

204

Likes

Translate

Translate

Report

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
Engaged ,
Jan 22, 2020 Jan 22, 2020

Copy link to clipboard

Copied

I researched your problem on Github.

There is no tangible and complete workaround to find out the solution to your problem.

I'd drop you a link to find out https://github.com/boazsegev/combine_pdf/issues/44

 

Likes

Translate

Translate

Report

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
Community Expert ,
Jan 22, 2020 Jan 22, 2020

Copy link to clipboard

Copied

When you say the bookmarks are "lost" do you mean that are gone entirely, or they are still there but don't work, or don't work correctly? My guess is it's happening because of the type of action they have. Using a script you can only create a command to execute a script, while pressing Ctrl+B creates a "Go to page view" action. You can't convert the one to the other in Acrobat automatically, but it can be done using an external tool, like this (paid-for) one I've developed: http://try67.blogspot.com/2011/09/convert-javascript-links-to-real-web.html

Likes

Translate

Translate

Report

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
New Here ,
Jan 22, 2020 Jan 22, 2020

Copy link to clipboard

Copied

LATEST

The individual bookmarks get removed completely and everything collapses down to one bookmark with the name of the PDF. So, while the original script builds out all of the bookmarks, after combining, all "Actions" are lost and only one bookmark remains.

Likes

Translate

Translate

Report

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