_       _       
  (_) ___ | |_ ____
  | |/ _ \| __|_  /
  | | (_) | |_ / / 
 _/ |\___/ \__/___|
|__/               

Edit ImageMagick security policy in Debian to allow PDF conversion

To allow ImageMagick to convert PDF files, you need to modify the security policy configuration by commenting out the following line in the file "/etc/ImageMagick-6/policy.xml":

  <policy domain="coder" rights="none" 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="none" pattern="PDF" />
  <policy domain="coder" rights="none" pattern="XPS" />

These policies were added to address a potential security issue with GhostScript, which apparently has since been addressed. To edit the policy.xml file, do the following:

sudo nano /etc/ImageMagick-6/policy.xml

...as shown below...

commented lines in /etc/ImageMagic-6/policy.xml

To test that ImageMagick can now convert PDF files, do something like the following, which converts the pages of a PDF file into PNG images:

convert -density 300 desk_sign.pdf slide.png

To check the resulting images with ristretto:

ristretto slide-0.png