title: GhostScript Batch Mode?
body: <p>I'm using GhostScript to convert PDFs to PNGs, the problem is that for each page I'm calling:</p>
  
  <p>gs -sDEVICE=pnggray -dBATCH -dNOPAUSE -dFirstPage=10 -dLastPage=10 -r600 -sOutputFile=image_10.png pdf_file.pdf</p>
  
  <p>Which is not good, I want to pass dFirstPage=10 dLastPage=30 for example and make GhostScript automatically extract each page in a SEPARATE png file WITH the PAGE-NUMBER in the filename, without starting it again with different sOutputFile...</p>
  
  <p>I know it's probably something simple but I'm missing it...</p>
  
  <p>Also, it would be great if someone can tell me what parameter I need to pass to make ghostscript run in total silence, without any output to the console.</p>
  
  <p>EDIT: Adding %d to the output parameter adds the number of the run, instead of the number of the page. For example:</p>
  
  <p>-dFirstPage=10 -dLastPage=15 -sOutputFile=image_%d.png</p>
  
  <p>results in:</p>
  
  <p>image_1.png, image_2.png, image_3.png etc... instead of:
  image_10.png, image_11.png, image_12.png ...</p>