title: How to find whether PDF has landscape orientation or portrait
body: <p>Are there tools to determine whether a PDF has landscape orientation or portrait?</p>
  
  <p>I have currently looked upon <strong>pdfbox</strong> and <strong>Itext</strong> for this but seem that I could not find it.  Please tell if they support this.</p>
  
  <p>Extracting the PDF pages information using <strong>Origami</strong> is providing a information the pdf pages have rotation of some degree. Here is what Origami reports:</p>
  
  <pre><code>{:Parent=&gt;#&lt;PDF::Reader::Reference:0x872349c @id=8, @gen=0&gt;, :Type=&gt;:Page, 
   :Contents=&gt;#&lt;PDF::Reader::Reference:0x8722f24 @id=4, @gen=0&gt;, :Resources=&gt;# &lt;PDF::Reader::Reference:0x870dbd8 @id=2, @gen=0&gt;, 
  :MediaBox=&gt;[0, 0, 612, 792], :Rotate=&gt;270}
  </code></pre>
  
  <p><strong>Rotate : 270</strong></p>
  
  <p>What does the 'rotation' actually mean?</p>