title: GhostScript, How to set custom page size using command line?
body: <p>I know that have a simillar question : <a href="https://stackoverflow.com/questions/12348864/how-to-change-ghostscript-output-file-in-printer-spooler">How to change Ghostscript output file (in printer spooler)</a></p>
  
  <p>but the answers was not helpful</p>
  
  <p>I using the command :</p>
  
  <p>-q -dBATCH -dNOPAUSE -dNODISPLAY  -c  "mark   /NoCancel true   /OutputFile (%printer%Ricoh c2051)  /UserSettings &lt;&lt; /DocumentName  (Test) /MaxResolution 600  >> (mswinpr2) finddevice putdeviceprops setdevice" -f  "C:\duplex.pdf"</p>
  
  <p>to set a custom name for document, but if a try to use "-sPAPERSIZE=a4" still the outputpaper size is "LETTER".</p>
  
  <p>then,how to change the paper type when I use these settings?</p>
  
  <p><strong>----Edit</strong></p>
  
  <p>after researching, I found out how to set the paper type. </p>
  
  <p>just added "/ PageSize [595 842]" (a4) at the prompt </p>
  
  <p>then the line becomes: </p>
  
  <p>-q-dBATCH-dNOPAUSE-dNODISPLAY-c "mark / NoCancel true / OutputFile (% printer% Ricoh c2051) <strong>/ PageSize [595 842]</strong> / UserSettings &lt;&lt; / DocumentName (Test) / maxResolution 600 >> (mswinpr2) FindDevice setdevice putdeviceprops "-f" C: \ duplex.pdf "****</p>