/errors/imagemagick/not-allowed-by-security-policy-pdf
ImageMagick: not allowed by the security policy `PDF'
The commands on this page have not been executed by our verification runner yet.updated 2026-10-20
- tool
- ImageMagick
- exit code
- 1
- versions
- ImageMagick 6, ImageMagick 7
- os
- linux
ImageMagick fails with attempt to perform an operation not allowed by the security policy PDF'when itspolicy.xml` forbids the PDF coder. Many Linux distributions ship that rule because ImageMagick hands PDF, PostScript and EPS files to Ghostscript, which has had serious vulnerabilities. Allow the coder only if the files you process are trusted.
Find the policy file
magick -list policy | head -20 # ImageMagick 7
convert -list policy | head -20 # ImageMagick 6The first lines show the path of the active policy.xml (for example /etc/ImageMagick-6/policy.xml on Debian and Ubuntu).
The rule that blocks PDF
<policy domain="coder" rights="none" pattern="PDF" />Fix: allow PDF for trusted input
<policy domain="coder" rights="read|write" pattern="PDF" />No restart is needed; the next ImageMagick command reads the file again.
Alternatives that avoid relaxing the policy
pdftoppm -png -r 150 input.pdf page # poppler-utils
gs -sDEVICE=png16m -r150 -o page-%d.png input.pdfSources
Related pages
config · imagemagickImageMagick policy.xml: resource limits and coder rulesImageMagick policy.xml limits memory, disk, image size and allowed formats. The policy domains, raising width or area limits, enabling or blocking coders.changes · imagemagickImageMagick 6 to 7: convert becomes magickImageMagick 7 replaces convert with magick, runs identify, mogrify and compare as magick subcommands, enables HDRI by default and changes the MagickCore C API.compare · ffmpegffmpeg -c copy vs re-encoding: speed, quality and limits-c copy remuxes streams without decoding: fast and lossless, but cuts snap to keyframes and filters are impossible. Re-encoding is slower, lossy, flexible.