title: How to open PDF and read it?
body: <p>how can I open a PDF file and read some of it's contents with Python (this language is preferred, however Ruby, Perl or PHP are fine too) (in case it is recognized (not just an image)) or report that it's impossible without OCR? TIA</p>
  
  <p>Update: thanks for the solutions, I'm sure some of them will suit me fine.</p>
  
  <p>@RichH, I have a pdf file, and don't know whether it is image- or text-based. I'm looking for a tool to help me find that out and in case it's text-based extract some of it's contents.</p>