HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

pdftoppm — Convert PDF document pages to portable Pixmap (image formats). More information: <https://manned.org

Submitted by: @import:tldr-pages··
0
Viewed 0 times
documentcommandconvertpagesclipdfportablepdftoppm
linux

Problem

How to use the pdftoppm command: Convert PDF document pages to portable Pixmap (image formats). More information: <https://manned.org/pdftoppm>.

Solution

pdftoppm — Convert PDF document pages to portable Pixmap (image formats). More information: <https://manned.org/pdftoppm>.

Specify the range of pages to convert (n - first page, m - last page):
pdftoppm -f {{n}} -l {{m}} {{path/to/file.pdf}} {{image_name_prefix}}


Convert only the first page of a PDF:
pdftoppm -singlefile {{path/to/file.pdf}} {{image_name_prefix}}


Generate a monochrome PBM file (instead of a color PPM file):
pdftoppm -mono {{path/to/file.pdf}} {{image_name_prefix}}


Generate a grayscale PGM file (instead of a color PPM file):
pdftoppm -gray {{path/to/file.pdf}} {{image_name_prefix}}


Generate a PNG file instead a PPM file:
pdftoppm -png {{path/to/file.pdf}} {{image_name_prefix}}

Code Snippets

Specify the range of pages to convert (`n` - first page, `m` - last page)

pdftoppm -f {{n}} -l {{m}} {{path/to/file.pdf}} {{image_name_prefix}}

Convert only the first page of a PDF

pdftoppm -singlefile {{path/to/file.pdf}} {{image_name_prefix}}

Generate a monochrome PBM file (instead of a color PPM file)

pdftoppm -mono {{path/to/file.pdf}} {{image_name_prefix}}

Generate a grayscale PGM file (instead of a color PPM file)

pdftoppm -gray {{path/to/file.pdf}} {{image_name_prefix}}

Generate a PNG file instead a PPM file

pdftoppm -png {{path/to/file.pdf}} {{image_name_prefix}}

Context

tldr-pages: linux/pdftoppm

Revisions (0)

No revisions yet.