0

I want to read a pdf file in python. Tried some of the ways- PdfReader and pdfquery but not getting the result in string format. Want to have some of the content from that pdf file. is there any way to do that?

nilay gupta
  • 195
  • 11
  • 2
    You can see at: http://stackoverflow.com/questions/2481945/how-to-read-line-by-line-in-pdf-file-using-pypdf – twots Aug 20 '15 at 06:50

2 Answers2

0

PDFminer is a tool for extracting information from PDF documents.

Community
  • 1
  • 1
Nishant Nawarkhede
  • 8,234
  • 12
  • 59
  • 81
-1

Does it matter in your case if file is pdf or not. If you just want to read your file as string, just open it as you would open a normal file.

E.g.-

with open('my_file.pdf') as file:
     content = file.read()
hspandher
  • 15,934
  • 2
  • 32
  • 45