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.
Gscan2pdf
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
searching for gscan2pdf
.
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:
- Flipping
- Rotating
- Renumbering
- 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
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!
LibreOffice
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
Conclusion
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. 👇
Comments
Dave
I recomend Gscan2pdf, it is really easy and doesn’t add borders like imagemagick does. Don’t forget to number like 01.png 02.png 10.png etc. and order by name before loading up.