I am using this code to open the file to find the size and dimension of PDF.
from PyPDF2 import PdfFileReader
with open(SourceFilePath, 'rb') as f:
input1 = PdfFileReader(f)
Most of the time I am able to open the PDF file using PdfFileReader
from PyPDF2
works fine, but with few PDF it throws this error:
NumberObject object is not subscriptable
Can anyone please help me why it is happening and how can I solve it?