I am getting this error "No /Root object! - Is this really a PDF?" using my MAC computer with Python 2.7 and PDFMiner version 20110515. The pdf files are not damaged because the same program with the same files works on my PC computer! Also I have tried many pdfs and this error exists for all of them. Any ideas of what I should change in my MAC to not to get this error?
I found the source of the problem:
I had a method to read all the files in a directory and parse them. Turns out that I had one hidden file in that directory that was not a pdf file!
Here is how I fixed the problem:
for filename in os.listdir(INPUT_DIR_NAME):
if filename.endswith('.pdf'):
#do stuff!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With