Rasterize PDF pages to images.

Synopsis

pdftoppm [options] <input.pdf> [output-prefix]

Description

Rasterizes PDF pages to images, writing <prefix>-<n>.<ext> per page, where <n> is zero-padded to the digit width of the last page (out-1.png for a 9-page document, out-01.png for a 12-page one).

Options

-png Write PNG (default).

-jpeg Write JPEG.

-jpegopt quality=N JPEG quality, 0-100 (default 90).

-r DPI Resolution in DPI (default 150).

-f N First page to render.

-l N Last page to render (clamped to the page count).

-scale-to N Scale the long edge to N pixels.

-scale-to-x N / -scale-to-y N Scale width / height to N pixels.

-singlefile Write exactly <prefix>.<ext>, with no page suffix.

-h, --help Show this help.

Examples

$ pdftoppm -png -r 150 doc.pdf page

Rasterize each page at 150 DPI to page-1.png, page-2.png, ...

$ pdftoppm -png -singlefile -scale-to 1024 doc.pdf cover

Rasterize the first page only, scaled so its long edge is 1024px.

Notes

If the output prefix is omitted it defaults to the input filename without its extension, in the current directory. Real poppler writes to stdout instead; binary stdout is not useful here, so this always writes files.

See Also

pdftocairo, pdftotext, magick