Clioos › Guides › PDF to JPG

How to Convert PDF to JPG

By Clioos 团队

A PDF page becomes one JPG file per page — there is no single JPG for a whole document. The free offline way is a short script or one command: on a 2-page A4 test report, 150 DPI gave 1241×1754 JPGs of about 44 KB each, and 300 DPI gave 2481×3508 JPGs of about 146 KB. Pick 150 for sharing, 300 for print.

At a glance

Steps

  1. Install Python 3 and PyMuPDF: pip install pymupdf.
  2. Save this script as pdf_to_jpg.py and put it in the same folder as your PDF.
  3. Run it: python pdf_to_jpg.py report.pdf 150 — one JPG per page, named report-p1.jpg, report-p2.jpg, and so on.
  4. Check the first output. On the test report, page 1 at 150 DPI came out 1241×1754 and 43,656 bytes:
    Page 1 of the test report rendered as a JPG at 150 DPI
    Page 1 of the test report as a 150 DPI JPG (1241×1754, 43,656 bytes). Rendered from the test PDF, 2 November 2026.
  5. For print, re-run at 300 DPI: page 1 becomes 2481×3508 and about 146 KB.
  6. Alternative without Python: pdftoppm -jpeg -r 150 report.pdf report (poppler) gives the same 2 JPGs — on the test file, 45,681 and 45,784 bytes, in 1.7 seconds.

The script (copy and run)

This is the exact script used for the test. It takes the PDF path and the DPI as arguments.

import sys
import fitz  # PyMuPDF

pdf_path, dpi = sys.argv[1], int(sys.argv[2])
doc = fitz.open(pdf_path)
for i, page in enumerate(doc):
    pix = page.get_pixmap(dpi=dpi)
    out = f"{pdf_path[:-4]}-p{i+1}.jpg"
    pix.save(out)
    print(out, pix.width, "x", pix.height)

File names come from the PDF name: report.pdf at 150 DPI gives report-p1.jpg and report-p2.jpg.

Worked example (tested 2 November 2026)

Test file: a 2-page A4 report (a short Q3 summary with four lines of figures). Both methods ran on the same file.

MethodDPIPage sizeFile sizesTime (2 pages)
PyMuPDF1501241×175443,656 / 43,921 bytes0.21 s
PyMuPDF3002481×3508146,013 / 146,687 bytes0.8 s
pdftoppm1501241×175445,681 / 45,784 bytes1.73 s

Sizes depend on page content: a photo-heavy page at the same DPI will be several times larger than this text-only report. The 300 DPI files are roughly 3.3× the 150 DPI ones, which matches the 4× pixel count minus JPG compression.

What it can't do

Free alternatives, honestly compared

Frequently asked questions

Is it free to convert PDF to JPG?

Yes, with the offline methods above — PyMuPDF and pdftoppm are free and open source, with no per-file charge. Browser tools are free up to a daily limit.

Can I get one JPG for the whole PDF?

No. JPG is a single-image format, so every converter gives you one file per page. If you need one file, keep the PDF or zip the JPGs.

What DPI should I use?

150 for screens, email and social posts; 300 for print. Above 300, files balloon with no visible gain on most printers.

JPG or PNG?

JPG for photos and scanned pages (smaller files). PNG for crisp line art, diagrams and screenshots of text — JPG compression blurs thin lines.

Will the JPG keep the PDF's text selectable?

No. A JPG is just pixels. If you need searchable text, keep the PDF or run OCR on the image afterwards.


Related guides: How to convert PDF to Word · How to convert PDF to Excel · How to convert a scanned PDF to Excel · All guides · Tool: PDF Probe