Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I programmatically open a pdf at a certain point?

Tags:

pdf

I've seen a few apps load up pdf files as the documentation but at a certain point within the pdf file. How were they doing this?

like image 921
Tim Matthews Avatar asked Jan 15 '09 12:01

Tim Matthews


People also ask

How do I force a PDF to open at a specific page?

Open a PDF file to a specific page To target an HTML link to a specific page in a PDF file, add #page=[page number] to the end of the link's URL.

How do I open a PDF file automatically?

When you save the PDF file, the file will automatically be opened with your default PDF viewer application, which is typically the free Adobe Reader software.

How do I link to a specific area in a PDF?

Choose Tools, click on Edit PDF, then on Link, and finally, select Add/Edit Web or Document Link. Select the area that you want to hyperlink. Then, in the Create Link dialog box, choose the options you want for the link appearance and click on the Open a Web Page button for the link action. Hit Next and enter the link.


1 Answers

Setting a page parameter or named destination on the URL. See the docs on open parameters:

Specifying PDF Open Parameters in a URL

You can specify multiple PDF Open parameters in a single URL. Each parameter is separated from the others with either an ampersand (&) or a pound (#) character. Actions are processed and executed from left to right as they appear on the URL command line. Because all specified actions are executed, it is possible that later actions will override the effects of previous actions, so it is important to be aware of the order. For example, page actions should appear before zoom actions. Commands are not case sensitive (except for the value of a named destination). There can be no spaces in the URL line.

URL Examples

http://example.org/doc.pdf#nameddest=Chapter6
http://example.org/doc.pdf#page=3
http://example.org/doc.pdf#page=3&zoom=200,250,100
http://example.org/doc.pdf#zoom=50
http://example.org/doc.pdf#page=72&view=fitH,100
http://example.org/doc.pdf#view=fitb&nameddest=Chapter3
http://example.org/doc.pdf#pagemode=none
http://example.org/doc.pdf#pagemode=bookmarks&page=2
http://example.org/doc.pdf#page=3&pagemode=thumbs
http://example.org/doc.pdf#collab=DAVFDF@http://review_server/Collab/user1
http://example.org/doc.pdf#page=1&comment=452fde0e-fd22-457c-84aa-2cf5bed5a349
http://example.org/doc.pdf#fdf=http://example.org/doc.fdf
like image 87
tvanfosson Avatar answered Sep 28 '22 05:09

tvanfosson