How can I link a page in a local PDF file?

自作多情 提交于 2020-06-14 04:53:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!