Get Current Page number of Embedded pdf

后端 未结 1 845
深忆病人
深忆病人 2020-12-21 06:15

I am planning to develop a webapp. The page will have an iframe on the left side and javascript form on right side. The iframe will be used to view pdfs from server.

相关标签:
1条回答
  • 2020-12-21 06:54

    One suggestion would be to try and use PDF.js, a PDF viewer that is built with HTML5. This might help you get around the need to use an iFrame to render the PDFs. But, if you need the iFrame for other reasons, then try looking at the PDF.js examples. As indicated on a previous stackoverflow thread, there are functions you could take advantage of:

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

    Hope this helps the cause.

    0 讨论(0)
提交回复
热议问题