Skip to content

ENH: Support reading link annotations #284

@tiarno

Description

@tiarno

I convert an html file to pdf with wkhtmltopdf and cannot find the named destinations in using PyPDF2.

The links in the pdf work and the destinations exist, but the structure is different from what I'm used to. Here is a link:

11 0 obj
<<
/Type /Annot
/Subtype /Link
/Rect [32.8200000  767.929999  51.5700000  779.179999 ]
/Border [0 0 0]
/Dest /file#3a##2fmytesting.htm#23myanchor
>>

And the destinations seem to be a bare list like this:

12 0 obj
<<
/__WKANCHOR_2 8 0 R
/__WKANCHOR_4 9 0 R
/file#3a#2fmytesting.htm#23myanchor 10 0 R
>>
endobj

Is there a way to find the destinations with PyPDF2?
The namedDestinations property returns an empty dict.
I've tried find to find the info from the resolvedObjects dict but so far with no luck.

thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PdfReaderThe PdfReader component is affectedis-featureA feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions