【发布时间】:2017-03-01 19:27:31
【问题描述】:
我在 html 中创建了一种目录,使用 #page=n 将特定页面链接到 pdf 中,如果我有 1 个链接用于 1 个 pdf,它就可以正常工作。
当我有多个指向同一个 pdf 的链接时,问题就来了。 即:
- href="001.pdf#page=10"
- href="001.pdf#page=20"
- href="001.pdf#page=30"
第一次它工作正常并在正确的页面上打开 pdf,然后如果我使用其他链接与 pdf opne,页面没有改变。 有解决办法吗?
感谢您的第一个回答。没错,我忘记了一些信息。 最终输出必须是跨浏览器的。
这是我的随机在线pdf的测试代码:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<a href="https://www.tutorialspoint.com/cplusplus/cpp_tutorial.pdf#page=5" target="PDFcontent">link 001</a>
<a href="https://www.tutorialspoint.com/cplusplus/cpp_tutorial.pdf#page=10" target="PDFcontent">link 002</a>
<a href="https://www.tutorialspoint.com/cplusplus/cpp_tutorial.pdf#page=15" target="PDFcontent">link 003</a>
<a href="https://www.tutorialspoint.com/cplusplus/cpp_tutorial.pdf#page=20" target="PDFcontent">link 004</a>
<a href="https://www.tutorialspoint.com/cplusplus/cpp_tutorial.pdf#page=25" target="PDFcontent">link 005</a>
<iframe style="height:800px; width:800px;" name="PDFcontent" src="http://www.naplesip.com/wp-content/uploads/2015/10/pdf-logo.png"></iframe>
</body>
</html>
我尝试在 jsfiddle 上使用它,但不起作用。相反,它适用于浏览器(firefox/chrome/edge/ie)。
【问题讨论】: