title: How do I resize a PDF to be exactly 8.5 x 11 inches using Ghostscript?
body: <p>Consider <a href="http://www.scs.stanford.edu/14au-cs244b/sched/readings/dean08mapreduce.pdf" rel="nofollow noreferrer">this PDF</a>. I am trying to convert it to standard letter size (8.5 x 11) using the following command.</p>
  
  <pre><code>gs -dFIXEDMEDIA -dBATCH -dNOPAUSE -sPAPERSIZE=letter \
     -dPDFFitPage -q -sDEVICE=pdfwrite -sOutputFile=out.pdf \
      dean08mapreduce.pdf
  </code></pre>
  
  <p>Here is <code>pdfinfo</code> on the output.</p>
  
  <pre><code>Producer:       GPL Ghostscript 9.10
  CreationDate:   Mon Nov 17 18:25:01 2014
  ModDate:        Mon Nov 17 18:25:01 2014
  Tagged:         no
  Form:           none
  Pages:          7
  Encrypted:      no
  Page size:      596.225 x 792 pts
  Page rot:       0
  File size:      126908 bytes
  Optimized:      no
  PDF version:    1.4
  </code></pre>
  
  <p>Here is <code>pdfinfo</code> on the original:</p>
  
  <pre><code>Producer:       Creo Normalizer JTP
  CreationDate:   Fri Dec 21 09:09:07 2007
  ModDate:        Fri Dec 21 14:46:23 2007
  Tagged:         no
  Form:           AcroForm
  Pages:          7
  Encrypted:      no
  Page size:      603 x 801 pts
  Page rot:       0
  File size:      235239 bytes
  Optimized:      yes
  PDF version:    1.3
  </code></pre>
  
  <p>Notice that the output has the correct height but not the correct width. It is effectively <code>8.3 x 11</code>, not <code>8.5 x 11</code>. </p>
  
  <p>I have tried the solutions <a href="https://stackoverflow.com/questions/14595521/how-to-set-the-physical-size-of-pdf-pages-with-ghostscript">here</a> and <a href="https://stackoverflow.com/questions/7446552/resizing-a-pdf-using-ghostscript">here</a> but neither achieves what I require.</p>
  
  <p><strong>How can I force the PDF to be exactly <code>8.5 x 11</code>?</strong> </p>
  
  <p>I do not mind if it involves adding a little whitespace on either side.</p>