I have multiple *.jpeg
pictures I like to merge into a single *.pdf
file like so:
convert Blatt1.jpg Blatt2.jpg Blatt3.jpg Blatt4.jpg out.pdf
I am prompted with the following exception:
convert: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408
What causes this problem and how can I fix it? I did some research but couldn't find anything about this particular problem.
ImageMagick has some security policies disabling some rights for security reasons. See why at the bottom of this answer.
You will have to edit a config file to re-enble the action you need.
Open
/etc/ImageMagick-6/policy.xml
with your favorite text editor, find the line<policy domain="coder" rights="none" pattern="PDF" />
and replace"none"
by"read|write"
About ImageMagick security policy
The restricted policy is made to prevent unknown vulnerabilities coming from third party software as Ghostscript used here for PDF files. Be sure to update Ghostscript.
Because of a known bug with security implications, the conversion to pdf is disabled in ImageMagick
convert
.I suggest that you work around the problem,
install img2pdf from the repository 'universe'
and run the following command line to create a
pdf
file with several pictures corresponding to the question or something similar for other cases,There are details for fine tuning in the manual
man img2pdf
Edit: There is a solution now, ghostscript is new enough in my computers, and I think in most up to date Linux operating systems:
So we can do the edits in the accepted answer and start using ghostscript again to convert to pdf with ImageMagick
convert
.