ImageMagick PDF Conversion: Authorization Issues and Solution
When attempting to convert PDF files to images using ImageMagick, users may encounter an error stating:
convert-im6.q16: not authorized `temp2.pdf' @ error/constitute.c/ReadImage/412.
This error indicates that ImageMagick lacks the necessary authorization to access the PDF file. To resolve this issue, the ImageMagick policy.xml file needs to be modified.
Solution:
Find the line containing:
<policy domain="module" rights="none" pattern="{PS,PDF,XPS}" />
Change the "rights" attribute from "none" to "read|write":
<policy domain="module" rights="read|write" pattern="{PS,PDF,XPS}" />
Some systems may have a policy line with "domain='coder'" instead of "domain='module'". Ensure to edit the correct line accordingly.
After performing these modifications, ImageMagick should have the appropriate authorization to access PDF files and successfully complete the conversion process.
The above is the detailed content of ImageMagick PDF Conversion Failing: How Do I Fix Authorization Errors?. For more information, please follow other related articles on the PHP Chinese website!