Forrest logo
back to the pdfimages tool

pdfimages:tldr:c3dfd

pdfimages: Extract all images from a PDF file and save them as PNGs.
$ pdfimages -png ${filename-pdf} ${filename_prefix}
try on your machine

The command pdfimages -png ${filename-pdf} ${filename_prefix} is used to extract images from a PDF file and save them as PNG images.

Here is a breakdown of the different components in the command:

  • pdfimages: This is the command-line tool used to extract images from a PDF file. It is typically installed as part of the Poppler utility package.

  • -png: Specifies the image format to be extracted. In this case, it is PNG. You can also use other formats like jpeg or tiff depending on your requirements.

  • ${filename-pdf}: This is a placeholder for the input PDF file name. You need to replace it with the actual name of the PDF file you want to extract images from. Make sure to include the file extension.

  • ${filename_prefix}: This is a placeholder for the desired prefix to be used when saving the extracted images. You need to replace it with the actual prefix you want to use. The extracted images will be saved with this prefix followed by a numerical index.

For example, if you have a PDF file named "document.pdf" and you want to save the extracted images with the prefix "img", the command would look like:

pdfimages -png document.pdf img

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 pdfimages tool