title: GhostScript command create thumbnail images from PDF file
body: <p>I am trying to create a thumbnail image from a PDF file. I am able to generate the JPEG image from the below command but the problem is I am not able to resize the output image to a fixed size ( 250x250 )</p>
  
  <p>The command -dPDFFitPage=true is making the output image to fit into the given dimension and the image is displaying as rotated. Can anyone help me fix this problem to generate the thumbnail images for a PDF file in 250x250 size.</p>
  
  <pre><code>/usr/bin/gs -dNOPAUSE -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -sOutputFile=&lt;path to output file&gt;%d.jpeg -dJPEGQ=100 -g250x250 -dUseCropBox=true  -dPDFFitPage=true -q  &lt;path to input file&gt;.pdf -c quit
  </code></pre>
  
  <p>Thanks
  Sachin</p>
  
  <p>Error with GhostScript 9.15 version</p>
  
  <p>As per the suggestion I have installed the Ghostscript 9.15 version.But after installing it is giving error to any command I passed. How to rectify or check if the GS 9.15 has been installed properly.  </p>
  
  <pre><code> **** Error reading a content stream. The page may be incomplete.
     **** File did not complete the page properly and may be damaged.
  Error: /ioerror in --showpage--
  Operand stack:
     1   true
  Execution stack:
     %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1945   1   3   %oparray_pop   1944   1   3   %oparray_pop   1928   1   3   %oparray_pop   --nostringval--   --nostringval--   2   1   1   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   1826   0   11   %oparray_pop   --nostringval--   --nostringval--
  Dictionary stack:
     --dict:1187/1684(ro)(G)--   --dict:1/20(G)--   --dict:82/200(L)--   --dict:82/200(L)--   --dict:116/127(ro)(G)--   --dict:280/300(ro)(G)--   --dict:30/32(L)--   --dict:6/8(L)--   --dict:21/40(L)--   --dict:1/1(ro)(G)--   --dict:7/17(L)--
  Current allocation mode is local
  Last OS error: No such file or directory
  GPL Ghostscript 9.15: Unrecoverable error, exit code 1
  Unrecoverable error: typecheck in setpagedevice
  </code></pre>