title: Converting postscript to pdf
body: <p>Following</p>
  
  <p><a href="https://stackoverflow.com/questions/10781588/converting-correctly-pdf-to-ps-and-vice-versa">Converting correctly pdf to ps and vice-versa</a></p>
  
  <p>I used the following command to convert a postscript file to pdf:</p>
  
  <pre><code>gs   -o output.pdf   -sDEVICE=pdfwrite   -dPDFSETTINGS=/prepress   -dHaveTrueTypes=true   -dEmbedAllFonts=true   -dSubsetFonts=false   -c ".setpdfwrite &lt;&lt;/NeverEmbed [ ]&gt;&gt; setdistillerparams"   -f mu-calc.ps
  </code></pre>
  
  <p>but I got an error (I got the same error with ps2pdf):</p>
  
  <blockquote>
    <p>GPL Ghostscript 9.06 (2012-08-08)
    Copyright (C) 2012 Artifex Software, Inc.  All rights reserved.
    This software comes with NO WARRANTY: see the file PUBLIC for details.
    Error: /undefinedfilename in (mu-calc.ps)
    Operand stack:</p>
    
    <p>Execution stack:
      %interp_exit   .runexec2   --nostringval--   --nostringval--<br>
    --nostringval--   2   %stopped_push   --nostringval--   --nostringval--<br>
    --nostringval--   false   1   %stopped_push
    Dictionary stack:
      --dict:1167/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
    Current allocation mode is local
    Last OS error: Permission denied
    GPL Ghostscript 9.06: Unrecoverable error, exit code 1</p>
  </blockquote>
  
  <p>I tried various other options at</p>
  
  <p><a href="https://stackoverflow.com/questions/27454350/ghostscript-unrecoverable-error-undefinedfilename-in-setpagedevice">Ghostscript: &quot;Unrecoverable error: undefinedfilename in setpagedevice&quot;</a></p>
  
  <p>but I always got the same error.</p>
  
  <p>How can I make it work?</p>