Bookmarks dropping after Combine Files
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!
