You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Read-only property accessing the destination page number."""
returnself.get("/Page")
refers to a page number we most likely never have.
You are of course invited to analyze this in detail and report here and open a corresponding PR if you have found a proper solution, but for now I honestly have some doubts that we can expect to have a consistent value here given the wide range of input data.
That's too bad - I'm sorry, I don't really have a proposal for how to fix this properly.
I think it would make sense to change the type hint and docstring to be consistent with Line 1624. The actual behavior of the page is to at least sometimes return an IndirectObject, so that should somehow be indicated in the documentation of the page property.
stefan6419846
changed the title
page property of Destination is mistyped.page property of Destination is mistyped
Apr 7, 2025
Uh oh!
There was an error while loading. Please reload this page.
I think this one is pretty simple. The
page
property of a destination is current documented (and type-annotated) as returning anOptional[int]
:pypdf/pypdf/generic/_data_structures.py
Line 1714 in 2363750
But in fact, what it returns is generally an
IndirectObject
, presumably because of how/Page
is initialized here:pypdf/pypdf/generic/_data_structures.py
Line 1634 in 2363750
The text was updated successfully, but these errors were encountered: