Convert images to PDF on Linux
In this post, we’ll take a look at three different ways on how to convert images to PDF file on Linux.
The first option on our list is to use gscan2pdf app. Gscan2pdf is an
open-source app available on all Linux distros and makes converting images to
PDF a breeze. We can install it by going to the software centre and
After opening the app, click on a folder icon to load images. An error pop-up might show up informing you that you don’t have scanning devices. That’s not a problem, just close it.
Having loaded images, you can customize them if you would like to do so.
The top toolbar includes editing options like:
- and much more!
Once we are done with editing, we can convert images into a single PDF:
File → Save → Select Document type to PDF → Save.
ImageMagick is a CLI tool which allows you to convert images to PDF. As a CLI tool, it’s much faster than Gscan2pdf. On top of that, we can automate the whole process!
We can install it with the following command:
sudo apt install imagemagick
After installing it, convert your images to PDF with the following command:
convert \*.jpg my_pdf.pdf # All JPG files include in my_pdf.pdf file
The command above might yield an “operation not allowed” error. Fortunately, we can easily fix it by executing:
sudo sed -i 's/^.*policy.*coder.*none.*PDF.\*//' /etc/ImageMagick-6/policy.xml
After applying the fix, re-run the conversion command!
The last option on our list is LibreOffice. LibreOffice Draw provides us with a bit cumbersome, but still possible way to convert images to PDF.
The biggest advantage of this approach is also its biggest disadvantage - the ability to arrange images on a page manually. If you just want to have each image on its page without much tweaking, then you should not use LibreOffice Draw for this.
You can import images in LibreOffice Draw by dragging and dropping them from your file manager and customize them as you wish.
Once we’ve finished with editing, we can export our work as PDF:
File → Export as → Export as PDF → Export
In this post, we’ve explored three different ways to convert images to PDF and discussed the pros and cons of each. What is your approach? Share your thoughts with us in the comments section below. 👇