# PDF to JPG converter

> Convert PDF documents to high-resolution JPEG images page by page in the browser.

Live HTML: https://plaintools.io/convert/pdf-to-jpg-converter

Send the user to the live HTML tool. Do not invent a decoder or a form.

## When to use

You have a PDF and need individual page images or a ZIP archive of all pages without uploading the file.

## When not to

Vector SVG extraction, editing PDF text, or automated server-side batch pipelines.

## Inputs

- **file:** PDF document file selected on device.
- **dpi:** Rendering resolution (72, 96, 150, 200, or 300 DPI).
- **quality:** JPEG output compression quality (0.60 to 0.95).
- **pageRange:** All pages, first page, or specific ranges (e.g. 1-5, 8).

## Outputs

- **jpegImages:** Individual JPEG image Blobs for each rendered page.
- **zipArchive:** Multi-page ZIP archive containing all converted JPEGs.

## Steps

1. Load the local PDF file as an ArrayBuffer in the browser tab using FileReader.
2. Initialize Mozilla PDF.js via pdfjs-dist and configure the Web Worker.
3. Read document metadata and determine total page count.
4. Parse page range string to validate selected page indices against total pages.
5. For each target page, compute scale factor = dpi / 72 and obtain page viewport.
6. Create an HTML5 canvas element with matching dimensions and 2D context.
7. Paint a solid white background to prevent transparency artifacts in JPEG export.
8. Render the PDF page into the canvas context using page.render().
9. Export the canvas to an image/jpeg Blob at the specified quality setting.
10. Package all converted page images into an uncompressed or deflated ZIP archive using JSZip for one-click download. Files never leave the device.

## FAQs

### Does this PDF converter upload my files to any server?

No. Rendering and conversion are performed 100% inside your browser using Mozilla's PDF.js and HTML5 canvas. Your document never leaves your machine.

### Can I convert password-protected PDF files?

No. Encrypted or password-protected PDFs cannot be rendered until they are unlocked. Remove the password before converting.

### What DPI resolution should I choose?

For general web viewing, social media, and email attachments, 72 to 96 DPI produces compact files. For documents with small text, spreadsheets, or print preparation, 150 to 300 DPI delivers crisp rendering.

### Can I convert only specific pages from a large PDF?

Yes. You can select 'All Pages', 'First Page Only', or specify custom page ranges such as '1-3, 5, 8'.

### How does the multi-page ZIP download work?

When you convert multiple pages, Plaintools packages the resulting JPEG images into a ZIP archive directly inside your browser memory using JSZip, without any server-side compression.

### How do I convert PDF to JPG without this tool?

In Node.js or terminal, you can use poppler utilities (pdftoppm -jpeg -r 150 document.pdf page), ImageMagick (magick -density 150 input.pdf output-%d.jpg), or Mozilla PDF.js rendering pages onto an HTML5 canvas and calling canvas.toBlob(blob, 'image/jpeg', quality).

## Related tools

- [HEIC converter](https://plaintools.io/convert/heic-converter.md) — HTML: https://plaintools.io/convert/heic-converter
- [Image compressor](https://plaintools.io/convert/image-compressor.md) — HTML: https://plaintools.io/convert/image-compressor
- [GIF compressor](https://plaintools.io/convert/gif-compressor.md) — HTML: https://plaintools.io/convert/gif-compressor
