34

There is a standard from Adobe that in theory specifies opening PDF documents from a link clicked in a browser in a way to open specific sections (AKA "anchor", "named reference") of PDF document. This functionality should be of great help if one would like to refer to a specific portion of large PDF (such as some standard or specification).

However, from what I see now, support for this standard is close to non-existent.

For example, these links should open Scala Reference PDF at section 3.2.6, "Annotated Types":

  1. http://www.scala-lang.org/docu/files/ScalaReference.pdf#subsection.3.2.6
  2. http://www.scala-lang.org/docu/files/ScalaReference.pdf#nameddest=subsection.3.2.6
  3. http://www.scala-lang.org/docu/files/ScalaReference.pdf#page=23

(Techincally, variant #3 should open page #23, which is essentially the same destination)

Is there a working way (may be with a couple of shims, proprietary wrappers or whatever else) to make this work on majority of systems? What is the usage share of Adobe Reader plugin, should I care about other systems?

If it's not possible, at least I'd like to find a working solution for every platform (i.e. Windows, Linux, Mac) that I could recommend to my site's users if they want to be able to use named destination links.

From what I've tested:

  • Windows, MSIE/Firefox/Chrome, Adobe Acrobat Reader plugin - all variants work with version 9+, but:
    • MSIE has a weird caching issue (i.e. anchor does not work until document was cached)
    • Older versions do not work
    • It has issues with link format: generally, it should be regular absolute link to a real web server, starting with "http://". Relative links, samba-style links (\\HOST\dir\file.pdf#something), anything else besides "http" (or probably, "https") scheme won't work
  • Windows, any browsers set up to run Adobe Acrobat Reader as a separate process - does not work
  • Windows, any browsers, FoxIt Reader - does not work
  • Windows, any browsers, CutePDF - does not work
  • Linux/Konqueror/Okular - only variant #1 works
  • Linux, any other browsers set up to run Okular or any other PDF viewer as external process - does not work (as browser does not pass any "#arguments" in a command line)
  • Any OS, Firefox 15+ PDF.js internal PDF viewer - does not work

I'd appreciate if you'd try it to test in various different combinations.

GreyCat
  • 16,622
  • 18
  • 74
  • 112
  • 1
    The base problem may be that what you call a *standard* from Adobe actually merely is a *guide* from the Adobe *Acrobat SDK* dating back to *2007*. While the PDF Reference in 2008 actually (with mainly editorial changes only) became an ISO standard, that URL guide AFAIK was not elevated likewise. Thus, that guide only is of relevance for Adobe Acrobat & Reader and their browser integration only (and maybe even for them in an outdated manner). Any other PDF viewer may have adopted some of those mechanisms, but they also may have adressing mechanisms of their own or none at all. – mkl Nov 17 '12 at 16:13
  • 1
    Concerning "Windows, any browsers set up to run Adobe Acrobat Reader as a separate process": AFAIK as a separate process those programs are opened by the browser with merely a path of a downloaded copy of the PDF. Thus, there is no chance for them to go to the desired position at all. – mkl Nov 17 '12 at 16:17

1 Answers1

18

What seems to work in general is variant #4 but using the number of the page as in actual division into pages in the PDF document, in this case

http://www.scala-lang.org/docu/files/ScalaReference.pdf#page=31

The PDF document has page numbers that start from the content proper, after the table of content, but that numbering differs from the one to be used in #page=...

Jukka K. Korpela
  • 195,524
  • 37
  • 270
  • 390
  • A JIRA issue has been created for this: https://issues.alfresco.com/jira/browse/MNT-12709 Please vote! – 4F2E4A2E Nov 17 '14 at 12:08
  • Wow thanks Jukka! This is super helpful for me. I spend a lot of time with pdfs. How did you figure this out? – Tomiwa Apr 18 '19 at 21:10
  • Just a note to say that if the PDF is meant for print and has 2 "magazine" pages per "pdf" page, you'll have to adjust your page numbers accordingly. eg: Page 40 of the magazine may actually be page 19 of the PDF file. (Cover as a single page.) – Jay Feb 15 '23 at 22:56