title: How do PDF coordinates work?
body: <p>I am trying to convert an ORACLE FAP file (yeah, I know, "fap"...hehe) into a PDF but have run into a snag. Here is what I have done:</p>
  
  <ol>
  <li>Found the Documentation <a href="http://download.oracle.com/docs/cd/E14902_01/fap_nafile_formats.pdf" rel="nofollow noreferrer">http://download.oracle.com/docs/cd/E14902_01/fap_nafile_formats.pdf</a></li>
  <li>Figured out the upi to PDF unit conversion is .03</li>
  <li>Parsed all of the Text (T) objects in a file to start off with.</li>
  <li>Made sure to adjust for the bottom-left origin PDF uses by using 792(height of PDF) - top-coordinate.</li>
  </ol>
  
  <p>When I try to render the form using Prawn (<a href="http://prawn.majesticseacreature.com/" rel="nofollow noreferrer">http://prawn.majesticseacreature.com/</a>) in Ruby, however, the text is offset all over the document so that most words over-take others. I have played with the unit conversion and tried changing around the coordinates to see if maybe the anchor points in PDF were not at the top-left (for elements) and I still can't get it.</p>
  
  <p>Any thoughts?</p>
  
  <p><img src="https://i.stack.imgur.com/tFJ4q.png" alt="Output"></p>