简体   繁体   English

如何链接本地 PDF 文件中的页面?

[英]How can I link a page in a local PDF file?

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).当用户使用 jQuery 单击按钮时,我加载一个 PDF 文件,但它从第一页开始打开文档(一如既往)。

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');
});

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.要将 HTML 链接定位到 PDF 文件中的特定页面,请将#page=[page number]到链接 URL 的末尾。

For example, this HTML tag opens page 4 of a PDF file named myfile.pdf:例如,此 HTML 标记打开名为 myfile.pdf 的 PDF 文件的第 4 页:

<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 : //helpx.adobe.com/acrobat/kb/link-html-pdf-page-acrobat.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM