PDF to JPEG Converter
How It Works:
- File Input: The
<input>
tag allows users to upload a PDF file. - PDF.js: The script reads the PDF using
PDF.js
and renders each page on a canvas. - Canvas to JPEG:
canvas.toDataURL('image/jpeg')
converts the canvas into a JPEG image. - Display Images: The JPEG images are displayed on the page.
Instructions:
- Save the code as
index.html
. - Open it in a modern browser (e.g., Chrome or Firefox).
- Upload a PDF file, and the JPEG images of its pages will appear below the input.