Forrest logo
back to the pdftoppm tool

pdftoppm:tldr:13870

pdftoppm: Generate a monochrome PBM file (instead of a color PPM file).
$ pdftoppm -mono ${filename-pdf} ${image_name_prefix}
try on your machine

The command pdftoppm -mono ${filename-pdf} ${image_name_prefix} is used to convert a PDF file to a series of monochrome images.

Here is the breakdown of the command:

  • pdftoppm: This is the command-line tool used for converting PDF files to various image formats.
  • -mono: It is an option for the pdftoppm command that specifies the conversion to monochrome (black and white) images. This means that the output images will only have two colors, black and white, without any shades of gray.
  • ${filename-pdf}: This is a placeholder that should be replaced with the actual name of the PDF file you want to convert. Make sure to include the file extension .pdf at the end.
  • ${image_name_prefix}: This is another placeholder that should be replaced with the desired prefix for the resulting image names. The converted images will be named with this prefix followed by a number indicating the page number. The appropriate file extension (such as .ppm for Portable Pixmap format) will be automatically appended.

For example, if you want to convert a file named document.pdf into monochrome images with the prefix page_, the command would be:

pdftoppm -mono document.pdf page_

This will generate a set of monochrome images with filenames like page_1.ppm, page_2.ppm, page_3.ppm, and so on, each corresponding to a page of the original PDF file.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the pdftoppm tool