【问题标题】:Get Current Page number of Embedded pdf获取嵌入式pdf的当前页码
【发布时间】:2015-07-20 21:06:24
【问题描述】:

我正计划开发一个网络应用程序。该页面将在左侧有一个 iframe,在右侧有一个 javascript 表单。 iframe 将用于从服务器查看 pdf。

我一直在寻找方法来捕获或获取在 iframe 中查看的 pdf 的当前页码。

这可能吗?

【问题讨论】:

  • 如何在 iframe 中显示 PDF?

标签: javascript jquery html pdf iframe


【解决方案1】:

一个建议是尝试使用PDF.js,这是一个使用 HTML5 构建的 PDF 查看器。这可能会帮助您解决使用 iFrame 呈现 PDF 的需要。但是,如果您出于其他原因需要 iFrame,请尝试查看 PDF.js 示例。如previous stackoverflow thread 所示,您可以利用以下功能:

PDFJS.getDocument('helloworld.pdf').then(function(pdf) {
    // you can now use *pdf* here

    pdf.getPage(1).then(function(page) {
            // you can now use *page* here
        });
}); 

希望这对事业有所帮助。

【讨论】:

    猜你喜欢
    • 2018-08-05
    • 1970-01-01
    • 2011-01-02
    • 1970-01-01
    • 2013-05-10
    • 1970-01-01
    • 2016-07-28
    • 1970-01-01
    • 2021-09-29
    相关资源
    最近更新 更多