0

I have updated the policy.xml file /etc/ImageMagick-6/policy.xml to have following

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

Even after updating this. I am getting this error attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408

My Convertion code is

$imgExt = new Imagick();
        $imgExt->readImage(public_path('storage/tk.pdf'));
        $imgExt->writeImages(public_path("storage/pdf_image_doc.jpg"), true);
        dd("Document has been converted");`


```




Did any one tell me how to solve this issue
  • PHP needs to have the full path to "gs" (Ghostscript) in the Imagemagick delegates.xml file for PDF entry. You also need to have Ghostscript installed in Imagemagick. See https://stackoverflow.com/questions/52861946/imagemagick-not-authorized-to-convert-pdf-to-an-image/52863413#52863413 – fmw42 Nov 10 '22 at 16:42

0 Answers0