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

HTML link to bookmark in pdf file

Contributor ,
May 23, 2011 May 23, 2011

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.

TOPICS
Scripting
5.2K
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
Community Expert ,
May 24, 2011 May 24, 2011

Try %20 instead of spaces. HTML links are URL-encoded, and this is the usual translation of a single space, as for example can be seen in links in Google.

If it works, you can automatically convert the bookmark name to URL format with the function encodeURI ("Every non-alphanumeric character is encoded as a percent escape").

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
Contributor ,
May 24, 2011 May 24, 2011

Thanks for the reply,

Unfortunately my colleague has already tried that and it didn't work.

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
New Here ,
Mar 30, 2016 Mar 30, 2016
LATEST

Jumping to a page inside a PDF can be done for a URL But bookmarks cannot be used inside a URL.  The trick is to use Named Destinations.  Here's an example:

http://www.reality-tech.com/url-to-a-location-inside-a-pdf/

Joel Plaut

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