title: Permissions Error Manipulating PDFs using GraphicsMagick (GM) on Google Cloud Functions
body: <p>I created a function on Google Cloud that manipulates images once they are uploaded to Google Cloud Storage.</p>
  <p>The function works well with nearly all the images types I require to support, except when I get to PDF handling. I am trying to convert PDFs to Images and I get the following error:</p>
  <pre><code>Failed to resize path/75/ae4d8a49-ea8e-4473-a679-14a372e2afba_rear.pdf. Error: Command failed: identify-im6.q16: not authorized `/tmp/ae4d8a49-ea8e-4473-a679-14a372e2afba_rear.pdf' @ error/constitute.c/ReadImage/412.
  </code></pre>
  <p>Upon googling this error, I found out is related to policies and suggest editing a <code>policy.xml</code> file (<a href="https://cromwell-intl.com/open-source/pdf-not-authorized.html" rel="nofollow noreferrer">https://cromwell-intl.com/open-source/pdf-not-authorized.html</a>). However, this does not seem to be possible within Google Cloud Function.</p>
  <p>Any ideas on how I can manipulate PDFs within Google Cloud Functions?</p>
  <p>Note: This may be related to <a href="https://stackoverflow.com/questions/48406271/google-cloud-function-permission-problems">Google cloud function permission problems</a></p>