Add the line below before </policymap> in the /etc/ImageMagick-7/policy.xml <policy domain="coder" rights="read | write" pattern="PDF" />