title: Is there a C++ library to extract text from a PDF file like PDFBox for Java?
body: <p>Last year, I made an application in Java using PDFBox to get the raw text in some PDF files and I need to port that application to C++ now.</p>
  
  <p>I wanted to know what was the best C++ alternative to accomplish what I need.</p>
  
  <p>I'll give an example in case it helps:</p>
  
  <p>Most files will look like this: <a href="http://www.jumbala.net/backup/league.pdf" rel="noreferrer">http://www.jumbala.net/backup/league.pdf</a></p>
  
  <p>With PDFBox, using that file, each line read on page 2 and most of page 3 would output all the data of a line, separated by a space instead of keeping it in a grid like it is now.</p>
  
  <p>So the first relevant line in page 2 would look like this:</p>
  
  <pre><code>FB 847 - Tremblay, Gérard 179,63 56 16167 90 268 s27 p3 669 s14 199 223 193 615
  </code></pre>
  
  <p>or something like that since there are minor changes in the order they appear, but I don't care about that as long as similar lines output the same since I just parse them and put the values I need in different variables.</p>
  
  <p>So, knowing all of that, is there a library that I can use in a C++ program to get similar results?</p>
  
  <p><strong>Edit:</strong> After looking at sacredFaith's link at <a href="http://www.codeproject.com/Articles/7056/Code-to-extract-plain-text-from-a-PDF-file" rel="noreferrer">http://www.codeproject.com/Articles/7056/Code-to-extract-plain-text-from-a-PDF-file</a> and trying it, I'm getting a weird output like such for the example file I mentioned earlier:</p>
  
  <p><a href="http://www.jumbala.net/backup/league.pdf.txt" rel="noreferrer">http://www.jumbala.net/backup/league.pdf.txt</a></p>
  
  <p>The parts I actually need are in the weird characters at the beginning. Using Adobe Acrobat Reader X and using Save As... Text (accessible), I get the following result:</p>
  
  <p><a href="http://www.jumbala.net/backup/league_good.pdf.txt" rel="noreferrer">http://www.jumbala.net/backup/league_good.pdf.txt</a></p>
  
  <p>Which is approximately what I get in Java using PDFBox and what I want to get as output in C++.</p>