Log in

View Full Version : Resolved Creating a link to a particular page of a pdf



james438
01-08-2014, 06:38 PM
Is there a way to create a hyperlink to a pdf that opens the online pdf to a particular page? Some pdfs can be rather long and if I am referencing a particular page it would be a little more convenient to let the page open to a particular location in the pdf.

jscheuer1
01-08-2014, 07:49 PM
Google gives (top result):

http://helpx.adobe.com/acrobat/kb/link-html-pdf-page-acrobat.html

See also:

https://www.google.com/search?client=opera&q=open+pdf+to+specific+page&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest

djr33
01-08-2014, 10:40 PM
This won't work for many users-- Acrobat is widespread for Windows (but not ubiquitous) and rare elsewhere. Mac users for example have a special plugin for Safari (the default browser) and many, like me, use a different browser and prefer to automatically download and open the documents in Preview (a viewer of various document types-- mostly images, pdfs). I'm not sure about Linux.

As a helpful hint, sure, there's no problem with this, but don't rely on it.

The required solution here is to simply list the page number for the user's information-- the great thing about PDFs is that they're a print format and consistent across computers, so you can easily refer to a page number, not something that works at all with normal hyperlinks to webpages.


Additionally, if you're creating the document itself, you can do one of two things:
1. Add a table of contexts that will direct them to the right section. Not all users are aware of this, but it can help for those who are. This works as bookmarks within the document itself; I don't think there's any (consistent) way to link to them from outside though.
2. Save the document so that a certain page is open when the document loads. I *think* this works for most viewers, but you'd have to test it to be sure.
Actually implementing either (depending on how you are generating the PDF) could be challenging, but it should be possible.

james438
01-09-2014, 04:11 AM
Thank you for the answers. I do get somewhat different results depending on the browser I use (namely Opera), so I will continue to cite page numbers next to my reference links. Also setting the page with #page=3 when it does work will take the user to page 3 of the document as opposed to the third page of the document. The difference is that the table of contents would not be counted when using #page=3 if what I am really referencing is the preface located before the document, but after the table of contents of the pdf. I hope that makes sense.

I hadn't done a google search for the answer earlier which was silly on my part. I'm not sure what I was thinking at the time. Ah, well.

Looking at the different parameters for viewing a pdf via URL I found this document to be the most useful: parameters for opening a pdf file (http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf), but it still didn't answer how to open the third page as opposed to page 3. If I were the creator of the pdf I could solve this easily, but if I am not and the option is available it does not appear to be something I can easily look up.

jscheuer1
01-09-2014, 04:51 AM
Are you saying that the first page in your document isn't page one? Like if you were to use #page=1 there would still be pages before that?

If so, I think if you have a standard or pro version of Acrobat (as opposed to just the reader) you can mark named destinations (like a named anchor in HTML) in any part of a document and use them.

One other thing you might try in a case like that would be using negative numbers, #page=-1 for the page 2 pages before page one if there are such pages.

Then again, you might just be confused by Opera. I found that once the document was loaded it didn't work so well in Opera. But that for a fresh link it worked fine.

james438
01-09-2014, 06:47 AM
I noticed that I had to open a fresh page as well. Some of the odd things I noticed when using Opera version 12 and the developer version was that page 3 would open paragraph 3 instead or it would open page 6. The results were not consistent either. I have since downloaded the latest version of acrobat reader and that appears to have cleaned up the errors I was seeing with Opera. I'm not sure how old my version of acrobat reader was.

I thought that what acrobat reader considered page 3 when using #page=3 was the third page of the document, but I may have read that wrong as I had trouble repeating it. This would be a little confusing if it was that way because some of the pdfs I read are snippets of much longer documents. For example one document consisted of pages 1569 to 1674. It appears that #page=3 always refers to the third page rather than page 3 of a document, which happens to be the way I was hoping to get it to work.

djr33
01-09-2014, 05:29 PM
Most often,* the identifying information for pages in a PDF is just numerical starting from 1 up to the end. It doesn't matter if there's any preface or table of contents or other material before page numbering would actually start (in a book, etc.). However, I think that technically each page is named (not in the text, but in the metadata, visible if you look at the thumbnails, I believe). So you should be able to figure out what page you want to go to (regardless of content, what metadata it has to identify it) and link to that. But again, it won't always be consistent by browser.

(*I have seen some documents, such as old books from archive.org, where the page numbering is properly aligned to the actual pagination in the text with some other numbering system used for the first few document pages then the actual page numbers, starting with 1, used later in the document.)

Note: I haven't really tested any of this, but I do use PDFs a lot. It'll take some trial and error to figure it out, and it'll probably work fine for some/most browsers.

james438
01-10-2014, 07:07 AM
When adding pdf parameters to a hyperlink I will try to test it out in multiple browsers first. I usually just view pdf documents within the browser, but if you download the pdf and then view it with adobe reader there appear to be more options available.

I will be sure to test the hyperlinks out with multiple browsers in the future when using pdf parameters. I was thinking that the unusual results were entirely on my end due to using an outdated reader, but that doesn't mean that the other parameters will create odd results including error messages with other browsers. I can play around with what you've told me about how the page numbering works as well as the metadata.

Question resolved.

jscheuer1
01-10-2014, 03:37 PM
I think what might be getting lost here is that most of the time this will work.

The one thing I'm uncertain of is the case of a document that spans multiple PDF files. Sounds like the page numbers, if sequential, work. Like if the 5th page of the second file in the document in page #105 in the overall document that #page=105 is used to reach that, right?

james438
01-10-2014, 11:20 PM
True, in the majority of cases it will work, but with the odd results I have recently had I will be sure to test this out in multiple browsers first in case it was not due to my using a version of adobe reader that was probably a year or more old.

As far as the example you listed it sounds like using #page=105 would be correct, but I have not heard of a document that spans multiple pdfs before.

jscheuer1
01-10-2014, 11:49 PM
Hmm, I thought you had already mentioned that you had documents that spanned more than one PDF file. I guess I misunderstood.

Now I would like to expand upon the other thing:

If it works in most cases with the obvious fall back/failure being that the file opens to its first or some other unexpected page leaving the user to search the PDF for the desired content, why test in so many browsers?

james438
01-11-2014, 01:50 AM
Just the major browsers, maybe 4 - 6 altogether. Sometimes I had error messages saying that the parameter I used was not recognized even though it was only one or two browsers that couldn't figure out what I was doing and it scrolled to some odd location in the pdf that had nothing to do with the parameter I set. djr33 recommends it and why not :)

Either way this is just for a matter of convenience for the user. If I consistently have no problems with my first few citations after testing it in multiple browsers then I will use the parameter and not worry about it. I will continue to list the page number next to the pdf documents that I cite.

djr33
01-11-2014, 02:54 AM
The real issue here will be plugins, not browsers. I imagine that IE/FF/Opera on Windows will behave very similarly (if not identically) if they're all using the Adobe Acrobat plugin. And possibly also on a Mac (and Linux?) if users do use such a plugin. But for users who have a different plugin or no plugin at all, it will likely behave very differently. And remember some devices (like iPhones) use native PDF readers that may have unique functionality.

So in short, testing this by installing multiple browsers on your machine won't work well. If it works in one browser, it'll probably work in the others. You'd actually need to test this with multiple machines (or at least different plugin combinations).

However, if you get it to work with the Adobe Acrobat plugin, then it might work with all of the other ones that would work at all-- they might copy the same functionality. I doubt the other plugins offer any specialized page-linking options (though I have no idea). So really you'll just end up with those that work because they're like Acrobat and those that don't. Fairly simple.

jscheuer1
01-11-2014, 04:11 AM
Chrome has a native reader and it works with that. I think most third party readers will try to emulate such a simple convention as page numbers.

djr33
01-11-2014, 04:22 AM
I think most third party readers will try to emulate such a simple convention as page numbers. That's assuming they're intended to be roughly equivalent. I don't know if that's a reliable assumption. The most basic behavior (such as whether a PDF downloads, opens in a new window, or opens in the same window) can vary, so I don't think page numbers would be reliable, no. If they do offer that option, then they probably do use the same format, but I wouldn't be surprised at all if they don't.

jscheuer1
01-11-2014, 04:34 AM
I think most will. The decision to view in the browser, the reader, or to download is made by how the browser and OS are configured and is a separate issue.