Blog

Converts the images to one pdf when using Linux OS

Written on January 12, 2025

Converting many images to one PDF file in Linux OS is very simple, and it goes through the following steps:

1. Install the conversion software

The software used is imagemagick, and the installation is also very simple, first open the terminal, and then enter:

sudo apt update

sudo apt install imagemagick

2. Modify the configuration of imagemagick

imagemagick has some security measures by default, which will cause errors when running the conversion, so it needs to be configured, and the configuration is very simple too, open the terminal, and then enter:

sudo sed -i '/disable ghostscript format types/,+6d' /etc/ImageMagick-6/policy.xml

3. Conversion

If all the images you want to convert are in the /tmp/image/ directory, and the images are named in the order of 1.jpg, 2.jpg, 3.jpg and so on, then the conversion is also very simple, open the terminal, and then enter:

cd /tmp/image/

convert *.jpg hehe.pdf

Then you can open the hehe.pdf with any PDF reading software

4. Miscellaneous

The imagemagick program can also easily convert the image format, for example, there is a 1.heic image in the /tmp/image/ directory, and if you want to convert it to 1.png, you can also open the terminal and enter:

cd /tmp/image/

convert 1.heic 1.png

The image has already been converted

Copyright © 2024 GxPDF
Email: support@gxpdf.com
Powered By Pruvious