Forrest logo
back to the pdftoppm tool

pdftoppm:tldr:2e769

pdftoppm: Convert only the first page of a PDF.
$ pdftoppm -singlefile ${filename-pdf} ${image_name_prefix}
try on your machine

The command "pdftoppm -singlefile ${filename-pdf} ${image_name_prefix}" is used to convert a PDF file into individual image files (in the ppm image format).

Here is a breakdown of the command:

  • "pdftoppm": This is the main command/utility used to convert PDF files to images. It is typically included in the Poppler utility package.

  • "-singlefile": This is an option or flag for the pdftoppm command. It tells the command to generate a separate image file for each page of the PDF.

  • "${filename-pdf}": This is a placeholder variable that should be replaced with the actual name of the PDF file you want to convert. Make sure to include the ".pdf" extension.

  • "${image_name_prefix}": This is another placeholder variable that should be replaced with the desired prefix for the generated image files. Each image file will be named with this prefix followed by a number indicating the page number. The file extension will depend on the ppm format (e.g., .ppm).

For example, if the PDF file is called "document.pdf" and you want the image files to be named "image_", the command would look like this:

pdftoppm -singlefile document.pdf image_

This would convert each page of the "document.pdf" file into individual images named "image_01.ppm", "image_02.ppm", etc.

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