Rasterize PDF pages to images (alias for pdftoppm).

Synopsis

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

Description

Same implementation as pdftoppm: rasterizes PDF pages to images, writing <prefix>-<n>.<ext> per page, zero-padded to the digit width of the last page. If the output prefix is omitted it defaults to the input filename without its extension, in the current directory.

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

$ pdftocairo -png -r 150 doc.pdf page

Rasterize each page at 150 DPI.

$ pdftocairo -jpeg -jpegopt quality=80 -f 1 -l 3 doc.pdf out

Render pages 1-3 as JPEG.

Notes

Real poppler's pdftocairo writes to stdout by default; here it behaves exactly like pdftoppm and writes files instead, since binary stdout is not useful in this shell.

See Also

pdftoppm, pdftotext, magick