0

I am using Spatie Media Library V7 and I am getting the following error when it attempts to perform a conversion

ImagickException: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408 in /var/www/html/vendor/spatie/pdf-to-image/src/Pdf.php:40

I have attepted the fixes from the following question without success

I have GD and ghostscript all setup as well

my policy.xml is setup as follows:

  <policy domain="module" rights="read|write" pattern="{PS,PDF,XPS}" />
  <policy domain="coder" rights="read|write" pattern="PS" />
  <policy domain="coder" rights="none" pattern="PS2" />
  <policy domain="coder" rights="none" pattern="PS3" />
  <policy domain="coder" rights="none" pattern="EPS" />
  <policy domain="coder" rights="read|write" pattern="PDF" />
  <policy domain="coder" rights="read|write" pattern="LABEL" />
  <policy domain="coder" rights="none" pattern="XPS" />

Any help will great be appreciated

Danny Younes
  • 579
  • 1
  • 6
  • 19
  • Change all the policy rights for PS and PDF entries to "read|write". – fmw42 Oct 12 '21 at 23:54
  • @fmw42 this has already been applied as you can see from the above code snippet – Danny Younes Oct 13 '21 at 00:03
  • Needs to be done for PS2, PS3, EPS, XPS. Also must be the policy location that Imagemagick is using - typically in /usr/local/etc/ImageMagick-X (X=6 or 7). Also you must have Ghostscript installed as a delegate or program. – fmw42 Oct 13 '21 at 00:07
  • my policy file is only located in /etc/ImageMagick-6/policy.xml and I do have ghostscript installed. I have changed on the types that you have mentioned still the same issue – Danny Younes Oct 13 '21 at 00:14
  • Are you on a shared server? If so, then only the hosting provider can make changes that relax the policy. You need to proper privileges to do so or they must do it. – fmw42 Oct 13 '21 at 01:01
  • I'm not on a shared server, I have full control of the server my policy file is now as follows – Danny Younes Oct 13 '21 at 01:46
  • What is your exact version and platform? What does `convert -version` show? (Or `magick -version` if on IM 7). What do you get from `convert -list format?` Try adding the full path to `gs` (Ghostscript) in the delegates.xml file for the PDF/PS etc entries in the `DEVICE` field. – fmw42 Oct 13 '21 at 03:38
  • Version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org Copyright: © 1999-2019 ImageMagick Studio LLC License: https://imagemagick.org/script/license.php Features: Cipher DPC Modules OpenMP Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib – Danny Younes Oct 13 '21 at 04:41
  • EPI PS rw- Encapsulated PostScript Interchange format EPS PS rw- Encapsulated PostScript EPS2 PS2 -w- Level II Encapsulated PostScript EPS3 PS3 -w+ Level III Encapsulated PostScript PCT* PICT rw- Apple Macintosh QuickDraw/PICT – Danny Younes Oct 13 '21 at 04:44
  • Here is what is the deletgates.xml file – Danny Younes Oct 13 '21 at 04:55
  • Your list of features do not include gs or gslib (for ghostscript). `Features: Cipher DPC Modules OpenMP Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib` So that makes me think that you might have it in your system, but not linked to Imagemagick. – fmw42 Oct 13 '21 at 15:40

0 Answers0