Technotes for future me

How to convert JPG to PDF in Linux

Install ImageMagick

sudo apt install ImageMagick

Convert JPG to PDF

sudo convert /home/ubuntu/blaat.jpg to /home/files/blaat.pdf

Sometimes you may get a policy error message saying convert: attempt to perform an operation not allowed by the security policy…

In such cases, open file /etc/ImageMagick-6/policy.xml in a text editor

sudo vi /etc/ImageMagick-6/policy.xml

and add the following line to it

<policy domain="coder” rights="read | write" pattern="PDF" />

before the following tag at the end of the file.



Last updated on 3 Jun 2022
Published on 3 Jun 2022
Edit on GitHub