ImageMagick not authorized to convert PDF to an image

前端 未结 4 1103
误落风尘
误落风尘 2020-11-22 06:01

I have a program, in which I need to convert a PDF to an image using Image Magick. I do that using the subprocess package:

        cmd = \'magic         


        
4条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 06:44

    emcconville is correct. More specifically edit the Imagemagick policy.xml file to uncomment this line:

      
    


    And change it from rights="none" to rights="read|write"

      
    


    This was a recent addition to the policy.xml file, I believe, due to a security flaw found in the Ghostscript delegate. I think that flaw has now been fixed in the current version of Ghostscript, which is 9.25.

    NOTE: On some systems the policy line will have domain="coder" rather than domain="module"

提交回复
热议问题