Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add popup annotation support #1195

Closed
MartinThoma opened this issue Aug 2, 2022 · 1 comment · Fixed by #1665
Closed

Add popup annotation support #1195

MartinThoma opened this issue Aug 2, 2022 · 1 comment · Fixed by #1665
Assignees
Labels
is-feature A feature request

Comments

@MartinThoma
Copy link
Member

Explanation

More complete feature support for annotations.

Code Example

Just like the other annotations

Hints

@MartinThoma MartinThoma added the is-feature A feature request label Aug 2, 2022
@MartinThoma MartinThoma self-assigned this Aug 2, 2022
@MartinThoma
Copy link
Member Author

MartinThoma commented Aug 3, 2022

A document with a popup is https://corpora.tika.apache.org/base/docs/govdocs1/919/919218.pdf. In my PDF viewer, it looks like this:
image

from PyPDF2 import PdfReader

reader = PdfReader('pdf/0358334a06fb777fd0187836840c9e9c.pdf')
reader.pages[0].annotations[1].get_object()

gives

{
    "/Type": "/Annot",
    "/Subtype": "/Popup",
    "/Rect": [
        154.16571,
        699.16745,
        619.16168,
        786.16669
    ],
    "/Open": true,
    "/F": 25,
    "/Parent": "IndirectObject(473, 0, 139986144693936)"
}

with the reader.pages[0].annotations[1].get_object()["/Parent"]

being

{
    "/Type": "/Annot",
    "/Subtype": "/Text",
    "/Rect": [
        154,
        764,
        172,
        786
    ],
    "/Open": true,
    "/Contents": "This report is one in a series.  More recent editions may be available.  To view a list of all in the series go to http://www.ojp.usdoj.gov/bjs/pubalp2.htm#ncvs",
    "/M": "D:20010522125319-05'00\"",
    "/T": "BJS",
    "/Popup": "IndirectObject(612, 0, 139986144693936)",
    "/F": 28,
    "/AP": "IndirectObject(615, 0, 139986144693936)"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is-feature A feature request
Projects
None yet
1 participant