Get the current page number of an embedded pdf

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

I've been looking for ways to grab or get the current pdf page number viewed in an iframe.

Is it possible?

+3


source to share


1 answer


One suggestion is to try using PDF.js , a PDF viewer that is built with HTML5. This can help you bypass the need to use an iFrame to render PDFs. But if you need an iFrame for other reasons, try looking at the PDF.js examples. As stated at fooobar.com/questions/774242 / ... , there are functions you could use:

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 case.

+1


source







All Articles