These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Automatic setting of Destinations

barneywray
Registered: Jan 15 2008
Posts: 8

Hi - Donna Baker refered me to this Forum after I posed this problem:

> I'm a rank newcomer to PDFs, bookmarks, destinations, and the Acrobat
> / interapplication Communications. I'm a software engineer, tasked
> with providing context-sensitive help (at the app procedure level) for
> a C# .NET windows app using a Word doc-converted-to-PDF using RoboHelp.
>>
> What caught my eye re. a Destination is that the drag-and-drop acrobat
> COM control in .NET provides a SetNamedDest("mydest") function,
> whereas I can't find an equivalent function for a Bookmark. The tech
> writer knows Word, links, Bookmarks and RoboHelp, but was clueless re.
> setting up Destinations in Word.
>
> So my first work-around is to hand-edit Destinations in the exported
> PDF file, using Acrobat 8.0. This works. The problem is the
> Destination definitions are lost each time the PDF is generated. So,
> next problem is How to regenerate the Destinations (to avoid
> hand-editing each time), either from the Word doc, ?javascript for
> Acrobat? The Interapplication Communicaitons SDK?
>
> Whatever general pointers, references to articles, sample code,
> alternative techniques, etc. Much Appreciated!
>
> Thanks,
> Barney Wray, Software Engineer
> Uster Technologies, Inc.
> Knoxville, TN
> USA

My Product Information:
Acrobat Standard 8.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Bookmarks and Destinations, while they may seem to be similar, are really very different things. Bookmarks are visual elements that appear in the bookmarks panel. Destinations are an internal PDF structure for specifying a navigation location. A bookmark usually uses a destination for it actions, but this is not always true. A bookmark in Acrobat is a generic button that could perform any available action.

Word has similar concepts. For example, each heading type (H1, H2, H3, etc.) is considered part of a Hierachal bookmark structure and can be used for things like creating a table of contents. If you have Acrobat Pro installed on the same system as Word, then work should have an Acrobat menu, which contains a "settings.." entry. In the settings you can specify the conversion of headings and other elements to bookmarks in PDF.

The right way to approach this is to use the existing word elements to convert into PDF bookmarks. But if you really want to perserve the active elements in a PDF, like bookmarks and links. Then do not overwrite your working PDF when you do the conversion. Instead, convert the word doc to a different file name. Then in Acrobat do a replace pages using the new doc. This replaces the existing page content without affecting the interactive elements on the PDF.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

barneywray
Registered: Jan 15 2008
Posts: 8
OK - Thanks Thom. My response:

I don't have Acrobat Pro; but in working with the Acrobat support in Word: the PDF generation via RoboHelp is currently generating Bookmarks. When I examine the output PDF, it does not have any named Destinations - I created those manually. So I assume that destinations are being generated by RoboHelp for the Bookmarks, but that they are not named (correct?). Is there a way to have the destination that is created for the Bookmark Named? I'm thinking that would solve the problem of how to generate the Named Destination when Bookmarks are being generated.

Second, can you tell me a bit about the "replace pages" in Acrobat? I think for that to function properly it would have to update the existing destinations so that they would point to the correct place when pages are altered.

Thanks - Barney
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I don't know the specifics of what RoboHelp does, but I think you've got it right. It's a good bet that RoboHelp is creating destinations for the bookmarks, they just aren't "named", i.e. globally available as a recource in the PDF. Named destinations are always created separatly from the mechanism that uses it. So creating a bookmark does not create a named destination. You could certainly create an Acrobat plug-in that would convert bookmark destinations into named destinations, or even create named destinations for each page independantly, but this seems like the long way around.

The "Replace pages" tool replaces page content one for one with the replacment doc, and that's all it does. So yes, if pages were added or changed significanlty the bookmarks destinations would be off and new destinations would need to be created. But this seems like a much smaller task than redoing all the bookmarks. Although you'll need Acrobat Pro for this.

I'm not quite getting what it is that you need, i.e., why "named" destinations are important. Is it just the bookmarks that need to be set up? or do the destinations need to be used by another mechanism like links, an internal JavaScript, or an external program?

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

barneywray
Registered: Jan 15 2008
Posts: 8
OK - the importance of the Named destination goes back to my initial posting - that is the mechanism I found that I can easily access via the .NET COM object for the Adobe Reader (the AxAcroPDFLib interface) - using the setNamedDest function. I would love to have a setBookmark function, too, but it does not appear to exist. setCurrentPage is there, but it forces me to maintain a page#-to-destination mapping in the application space. I'm trying to avoid that by putting the change maintenance in the PDF file instead.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Ahh, this is what I thought. You want to control the Acrobat viewer from an external application by using named destinations. Unfortunately, Acrobat does not provide a way to automatically create Named Dests. This would be nice, but there aren't any methods in Acrobat JavaScript or the IAC (what you're using). There is functionality for this in the Plug-in SDK, but like I said before, that might be overkill.

There is another way. From the IAC you can perform a bookmark action. Look in the IAC reference at the "AcroExch.PDBookmark.perform()" function. I think this does exactly what you want.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

barneywray
Registered: Jan 15 2008
Posts: 8
Absolutely. My initial work to get access via the AxAcroPDFLib interface was successful, while my attempts to get at the AcroExch.PDBookmark failed, hence the road I took. So it looks like I need to go find help on that problem.

Thanks again.