问题
I load a PDF file when user clicks a button using jQuery, but it opens the document starting from the first page (as it is always).
I would like to link a specific page depending of the needed chapter. Is it there any way to do this nice to have thing?
Here is how I open the document:
$('#btnManual').click(function() {
window.open('documentation/test.pdf');
});
回答1:
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.
For example, this HTML tag opens page 4 of a PDF file named myfile.pdf:
<A HREF="http://www.example.com/myfile.pdf#page=4">
More info: https://helpx.adobe.com/acrobat/kb/link-html-pdf-page-acrobat.html
来源:https://stackoverflow.com/questions/50246305/how-can-i-link-a-page-in-a-local-pdf-file