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

HTML link to bookmark in pdf file

gwh
Registered: May 19 2008
Posts: 47

Hi everyone,
 
I use the following suffix on an html link in order to link to a specific page within a pdf file:
 
#page=15
 
This works but I need to know go one step further and link to a specific bookmark within the pdf. I use the following suffix to try to do this:
 
#bookmark name
 
The above syntax doesn't work because the bookmarks all have spaces in their names. Apparently it's supposed to work if I remove the spaces from the bookmark names but this isn't practical because I'm generating the pdf out of Indesign and the bookmarks in the resulting pdf are just a reflection of the table of contents in Indesign. I can't remove the spaces from the TOC entries just so that there's no spaces in the bookmarks in the pdf.
 
So I need some sort of workaround and wondered if anyone would have any suggestions. Is there some acrobat script or any other solution to this problem?
 
Really appreciate any help.

My Product Information:
Acrobat Pro Extended 10.0.2, Macintosh
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Where did you see that you could link to a bookmark this way? It's not documented in the PDF Open Parameters reference file. You can specify to have the bookmarks panel open (using #pagemode=bookmarks), but you can't specify that the file opens on a specific bookmark (anyway, some bookmarks don't lead to a page at all, others can have the same name, so how would that work?)
What you can do, though, is either point to a certain page (like you mentioned), or to a named destination, like so:
#nameddest=Chapter6
You can then have your bookmarks point to these destinations as well.

On a side-note, it is possible to have a file open on a bookmark using a script and a pre-defined URL parameter.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

gwh
Registered: May 19 2008
Posts: 47
Thanks for the reply,

I was told by a colleague about linking to a bookmark. Currently, if you click a bookmark, it works like a named anchor in html, i.e it jumps to a specific heading in the pdf file. I mentioned before that the bookmarks were created when I exported the file from indesign and the bookmarks are a reflection of the table of contents. So entries in the table of contents link to certain styled headings within the document. This is what we'd like to do, i.e to have several links on a website that point to one or another of these bookmarks so that when the pdf file opens it will jump to that position on the page.

Regarding the named destination, I'm assuming these would need to be created manually within the pdf file - is that right? It kind of seems like a waste of time since the bookmarks are already there and they contain the destination where the html link would need to jump to.

When you say it is possible to have a file open on a bookmark using a script and a pre-defined URL parameter, does this mean that what I'm asking is possible? Is the script used in the pdf file or is it called once the link is clicked. Would this be a custom script and if yes, is it a commercial script?
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Many applications create Named Destinations automatically when creating a PDF. I'm pretty sure InDesign can do that as well. Actually, it might already did... check the properties of your bookmarks and see what action they have. I'm guessing its a go to page view or go to named destination. If the latter, then you can reuse that in your URLs.

Regarding the script: It's executed in the PDF file itself when it is opened. And yes, it's a custom-made commercial tool that I've created. Feel free to contact me personally to discuss it further.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

gwh
Registered: May 19 2008
Posts: 47
Yeah you're right - I just looked at the properties of one of the bookmarks and it said:

Go to a page in this document
Destination name: p24

Just again regarding your script, can you explain a little further how it works so I can pass on the information to a decision-maker? Does it work with multiple pre-defined urls that may exist on a web page?
try67
Expert
Registered: Oct 30 2008
Posts: 2398
It works by embedding a script into the PDF that is launched when it is opened, and then looks for a URL parameter (for example #bookmark=), and if it finds it, it will look for the matching bookmark and launch its action.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

gwh
Registered: May 19 2008
Posts: 47
Ok great - I'll pass on the information and will get back to you.

Thanks again