# PDF to PNG converter

> Convert PDF documents to crisp, lossless PNG images page by page in the browser.

Live HTML: https://plaintools.io/convert/pdf-to-png-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 high-resolution PNG page images or a ZIP archive without uploading the document.

## When not to

Editing PDF vector paths or server-side headless rendering pipelines.

## Inputs

- **file:** PDF document file selected on device.
- **dpi:** Rendering resolution (72, 150, or 300 DPI).
- **pageRange:** All pages, first page only, or custom range (e.g. 1-3, 5).
- **transparentBackground:** Opaque white background or transparent background.

## Outputs

- **pngImages:** Individual lossless PNG image Blobs for each rendered page.
- **zipArchive:** Multi-page ZIP archive containing all converted PNGs.

## Steps

1. Load PDF file as an ArrayBuffer, creating sliced copies to prevent ArrayBuffer detachment.
2. Initialize Mozilla PDF.js in the browser and read document page count.
3. Validate requested page ranges against total page count.
4. For each target page, compute scale factor = dpi / 72 and obtain page viewport.
5. Create an HTML5 canvas element with matching dimensions and 2D rendering context.
6. Fill with opaque white background or transparent canvas depending on preference.
7. Render the PDF page into the canvas context using page.render().
8. Export the canvas to an image/png Blob.
9. Package all converted page images into a ZIP archive using JSZip for one-click multi-page download.

## FAQs

### Does this PDF to PNG converter upload my documents to any server?

No. All rendering and image rasterization happen 100% inside your browser using Mozilla's PDF.js and HTML5 canvas. Your documents never leave your computer.

### What is the difference between PDF to PNG and PDF to JPG?

PNG uses lossless compression, preserving pixel-perfect sharpness for line art, screenshots, blueprints, and text without compression artifacts. JPG uses lossy compression, which is better for photographic content where smaller file size is prioritized.

### Which DPI resolution should I choose for PNG output?

Use 72 DPI for web previews and quick email sharing. Use 150 DPI for e-readers, documentation, and tablet displays. Use 300 DPI for high-resolution graphics, diagrams, and printing.

### Can I export PDF pages with transparent backgrounds?

Yes. Toggle 'Background Transparency' to Transparent Background to render pages without an opaque white background, allowing graphics and charts to be overlaid on other designs.

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

No. Encrypted or password-protected PDF files cannot be decrypted without the password. Remove the password before uploading.

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

Using Poppler utilities in terminal: pdftoppm -png -r 150 document.pdf page. Using ImageMagick: magick -density 150 input.pdf output-%d.png. Or in JavaScript: use pdfjs-dist to get the page viewport and render onto an HTML5 canvas, then call canvas.toBlob(blob, 'image/png').

## Related tools

- [Image compressor](https://plaintools.io/convert/image-compressor.md) — HTML: https://plaintools.io/convert/image-compressor
- [PDF to JPG converter](https://plaintools.io/convert/pdf-to-jpg-converter.md) — HTML: https://plaintools.io/convert/pdf-to-jpg-converter
- [Picture to text converter](https://plaintools.io/convert/picture-to-text-converter.md) — HTML: https://plaintools.io/convert/picture-to-text-converter
