-
I'm moving from PyPDF2 1.x to current
This code works as expected, however, Any idea why I could be seeing this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
the annotation of the get( |
Beta Was this translation helpful? Give feedback.
the annotation of the get(
[ ]
) of a DictionaryObject such as trailer indicates the generic common type PdfObject, to prevent errors, you need to cast it to the adequate type):root = cast(DictionaryObject,reader.trailer[TrailerKeys.ROOT])
you may neeed to add a global
from pypdf.generic import *