title: Parsing PDF file using Apache PDFBox
body: <p>I am trying to modify the contents of a PDF document using <a href="http://pdfbox.apache.org/" rel="nofollow">PDFBox</a>. I used <a href="http://svn.apache.org/repos/asf/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ReplaceString.java" rel="nofollow">this example</a> as it is, but observed that the text it my PDF file is getting split at character level (or worse). For example, a string,<code>EM? what it is:</code> gets split into:</p>
  
  <pre><code>COSString{E}
  COSString{M?}
  COSString{ }
  COSString{w}
  COSString{hat }
  COSString{it }
  COSString{is}
  COSString{:}
  </code></pre>
  
  <p>(when checked by printing the <code>cosString</code> in the above mentioned code). As far as I can see, there are only Latin characters in the file, and the encoding is also ISO-8859-1. Any ideas?</p>
  
  <p>Regards,</p>
  
  <p>Salil</p>