title: How do you programmatically - or from CLI - rotate a PDF?
body: <p>What I need to be able to do is to rotate a PDF clockwise or counter clockwise either programmatically or from the CLI.  </p>
  
  <p>I have spent considerable time researching and attempting to rotate PDFs with GhostScript (as GS is already installed for other reasons) to no avail, nothing seems result in any rotation.</p>
  
  <p>I have looked into using pdftk but it requires java libraries, and I would rather not have java installed on the system.</p>
  
  <p>We've even looked at modifying the PDF file ourselves, and we have had some success with this, but we haven't come across a reliable method that works for all PDFs.</p>
  
  <p>So my #1 preference would be to achieve this with existing resources on the system.
  My #2 preference would be to do a little modification to the existing system as possible to achieve this.  </p>
  
  <p>The server in question is using Linux (OpenSuse 11) with PHP 5.2 and I have Ghostscript 9.0 installed. </p>
  
  <p>Any advice would be much appreciated. </p>