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

时间:2021-11-09 21:16:06

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

1 个解决方案

#1


6  

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 = [页码]添加到链接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

#1


6  

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 = [页码]添加到链接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