Want to easily generate image files from a PDF document in Linux, then you can do it from pdftoppm. pdftoppm is a free and open source command-line utility for Linux. Using this you can convert your PDF documents into image files. It allows you to configure the file format, color filter such as grayscale and dimensions of the output images. This command-line tool comes with poppler-utils package. It Supports PNG, JPEG, JPEGCMYK, JPEGOPT and TIFF file formats.
How to install pdftoppm poppler-utils on Ubuntu Linux
If it not preinstalled on your Ubuntu based distro, then open the terminal software (ctl+alt+t) and run below commands one by one.
sudo apt update
sudo apt install poppler-utils
How to Convert PDF to Image
You can convert PDF to image by using the below command Syntax.
pdftoppm -format document image
Here
format is the output image file extension.
document is the path to the PDF file
image is the name of the output image.
Example:
Document sample.pdf in Downloads folder
First navigate to the Downloads folder.
cd Downloads
Then run below command to convert sample.pdf to image.png. If the document has multiple pages, pdftoppm will append numbers in file name, e.g. image-1 and image-2.
pdftoppm -png sample.pdf image
Now check Downloads folder.
For the complete usage details run below command.
pdftoppm -help
That’s it.