-3

I want to read the metadata of pdf files so i am using pyPdf package but for some files i am facing error (i.e;PdfFileReader stream/file object is not in binary mode,it may not be read correctly)

Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
praveen JP
  • 9
  • 2
  • 10
  • 1
    If you know just help me but with out giving proper answer you are just giving minus to my question – praveen JP Jan 19 '17 at 14:33
  • I didn't downvote you but the reason people would do so is that you haven't shared any code nor told us what you have tried. Have a look here: https://meta.stackoverflow.com/questions/284236/why-is-can-someone-help-me-not-an-actual-question – The_Cthulhu_Kid Jul 19 '17 at 06:33

1 Answers1

1

You need to read the file in binary mode:

from pyPdf import PdfFileReader
with open('document.pdf', 'rb') as f:
    pdf = PdfFileReader(f)
crhodes
  • 1,178
  • 9
  • 20