I have embedded a PDF document using the html object tag, and displayed it on one section of the webpage. Another section contains a tree-view of links (looks like the PDF's bookmarks). Clicking on a link in the tree-view reloads the PDF document and opens it on the correct page (page number is contained in the links). Is there a way to accomplish this without reloading the document?
To rephrase the question, I am looking for a JavaScript function that could imitate the behavior of the bookmarks - jumping to the page number without reloading the document.
In Acrobat open the PDF document properties (Ctrl+D) and in the Initial view tab select Page Layout: Two-Up (Cover page). Then press OK and Save the file. That's it!
In Chrome, Ctrl + Shift + click opens a link in a new tab from a PDF (Windows). You can also right click and select 'Open link in new tab'.
Yes, you can open the embedded attachments in the Adobe Acrobat Reader mobile application. Please refer to the steps provided below to open the attachments on the Android device. - Open the PDF with attachments in the Adobe Acrobat Reader. - Then click on the three dots provided at the top right of the screen.
I think there is no native method in JavaScript that would provide that functionality. You are going to need a library.
The easiest way would be to use a well documented library to work with pdf documents in JavaScript. PDF.js is a very good project in that sense, although it renders the pdf itself, instead of using Acrobat Reader, which might give problems with complicated documents.
Another solution, using Adobe Acrobat reader, would be to use their own JavaScript API, following that link you will see the complete API reference. Quoting from that document (Page 254):
pageNum
Gets or sets the current page of the document. When setting pageNum to a specific page, remember that the values are 0-based. [...]
So if you wanted to go to a specific page of the document you could use
this.pageNum = 6;
Where this should be the app context. Here you can find the online API reference with more documentation and examples.
Some guides on using the above JS API:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With