title: How do I use pdfminer as a library
body: <p>I am trying to get text data from a pdf using <a href="http://www.unixuser.org/~euske/python/pdfminer/index.html" rel="noreferrer">pdfminer</a>.  I am able to extract this data to a .txt file successfully with the pdfminer command line tool pdf2txt.py.  I currently do this and then use a python script to clean up the .txt file.  I would like to incorporate the pdf extract process into the script and save myself a step.  </p>
  
  <p><a href="https://stackoverflow.com/questions/25665/python-module-for-converting-pdf-to-text">I thought I was on to something when I found this link</a>, but I didn't have success with any of the solutions.  Perhaps the function listed there needs to be updated again because I am using a newer version of pdfminer.  </p>
  
  <p><a href="http://www.herblainchbury.com/2010/05/opendatabc-extracting-data-from-a4ca.html" rel="noreferrer">I also tried the function shown here, but it also did not work.</a>  </p>
  
  <p>Another approach I tried was to call the script within a script using <code>os.system</code>.  This was also unsuccessful.</p>
  
  <p>I am using Python version 2.7.1 and pdfminer version 20110227.</p>