javascript 谷歌浏览器 PDF 查看器 API?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14210865/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 21:01:01  来源:igfitidea点击:

Google Chrome PDF Viewer API?

javascriptgoogle-chromepdf-reader

提问by Ebrahim Byagowi

Is there any API for interacting with Google Chrome PDF Viewer, pdfium? Like reading page number of current page or setting current page (like Adobe #page=10) or a supporting library like PDFObjectfor doing these?

是否有用于与 Google Chrome PDF Viewer、pdfium交互的 API ?喜欢阅读当前页面的页码或设置当前页面(如Adobe#page=10)或支持库(如PDFObject )来执行这些操作?

采纳答案by Sudarshan

Chrome PDF Reader supports #page=Xas a postfix to the URL in order to jump to a specific page in a PDF document

Chrome PDF Reader 支持#page=X作为 URL 的后缀,以便跳转到 PDF 文档中的特定页面

Say you are reading a page at https://www.example.com/examplePDF#page=4it opens page 4 directly.

假设您正在阅读一个页面,https://www.example.com/examplePDF#page=4它会直接打开第 4 页。

回答by scartag

If your goal is client side pdf viewing using js, you might want to take a look at PDF.jsIt is even open source.

如果您的目标是使用 js 查看客户端 pdf,您可能想看看PDF.js它甚至是开源的。