How to turn element to document or how to use it

Viewed 26

I've a input type file that input pdf file that use in pdfjs-dist.

<input id="file" type="file" />

var pdffile = document.getElementbyId(file).files[0]; // Did I do the wrong way?

pdfjsLib.getDocument(pdffile).then(doc =>{  // How to use this in here
            console.log("This file has" + doc.pdfInfo.numPages + "pages");
        });

and I want to use this file as a document how can i do.

0 Answers
Related