Skip to content

KeyError: '/A' #2527

Answered by pubpub-zz
pingorczinger asked this question in Q&A
Discussion options

You must be logged in to vote

oups!!!
found my mistake:

from pypdf import PdfReader

pdf = PdfReader(PdfFile)
for page in pdf.pages:
           ano=page.get("/Annots",())
           for a in ano:
                a = a.get_object()
                if "/A" in a:
                     if "/URI" in a["/A"]:
                         print(a["/A"]["/URI"])

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by stefan6419846
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
is-question Rather a question than an issue. Should usually be a Discussion instead workflow-annotation Everything about annotating PDF files
2 participants
Converted from issue

This discussion was converted from issue #2517 on March 17, 2024 10:03.