Trouble with batch conversion of .png to .pdf using convert

convert-im6.q16: not authorized `myfile.pdf' @ error/constitute.c/WriteImage/1037.

วิธีแก้

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

หาบรรทัดนี้

<policy domain="coder" rights="none" pattern="PDF" />

แล้วแก้

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