How to use:
In this example, the user will first upload a pdf file using the Html <input /> tag and then we will preview it
using pdf js.
First import the necessary scripts in your Html file like this:
Now, add the necessary Html elements under the body tag:
The user will choose the file using the input tag and the pdf will be shown in the canvas.
In the above script, an event listener will load the pdf in the canvas when the user uploads a file using the HTML <input /> tag. The result should be something like this:
Thanks for reading!