title: Parse PDF Shape Objects with iTextSharp using .Net
body: <p>I'm trying to parse a bunch of PDF's that have a section of what appears to be text, but in reality is just a bunch of embedded shapes to <em>look like</em> text, so extracting that 'text' using the normal PdfTextExtractor object in iTextSharp is not possible.</p>
  
  <p>Since the text I am trying to extract is one of only 10 possible words, instead of actually 'reading' the word (or rather, 'shapes in the form of a word'), I figured I can determine what the word is by comparing it against others that I have already identified.</p>
  
  <p>My first question is, How do I even get to this section of the PDF? How would I use iText to parse the document to drill down to this shape object? There is a common word that begins this section on all my documents, so I thought I can use that as a landmark to know when I'm in the right area, but how do I even iterate through all the shapes of the document?</p>
  
  <p>Then, once I find it, how do I identify the particular shapes (line segments?) of the other words to determine what letters I'm looking at?</p>
  
  <p>To illustrate the problem, here's a comparable scenario - The section I need to parse is a map legend, and it will be an area of the PDF that looks like this:</p>
  
  <p>-- LEGEND --</p>
  
  <ul>
  <li>road</li>
  <li>highway</li>
  <li>river</li>
  </ul>
  
  <p>If I find the shape representing the word 'LEGEND' I know I'm in the right area, and then I can try determining what words are in the legend (since it's a limited list of around 10 words). But how do I do that?</p>
  
  <p>I'm using .NET, so any C# or VB.Net code samples should work for me.</p>