系統 - Debian - 解決Attempt to perform an operation not allowed by the security policy PDF問題



參考資訊:
https://stackoverflow.com/questions/52998331/imagemagick-security-policy-pdf-blocking-conversion

問題如下:

$ convert -density 300 1.pdf 1.jpg
    convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/426.
    convert-im6.q16: no images defined `1.jpg' @ error/convert.c/ConvertImageCommand/3229.

解法如下:

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