Skip to content

How to get pop-up attributes from elements #3189

Answered by JorjMcKie
immartyn asked this question in Q&A
Discussion options

You must be logged in to vote

That other file, pic_programmer.pdf does not store the JS in separate objects but leaves them inside the abused link objects. So your code must be like this:

for xref in range(1, doc.xref_length()):
    subtype = doc.xref_get_key(xref, "Subtype")
    if subtype[0] != "Link":    # not a Link annotation
        continue
    source = doc.xref_get_key(xref, "A/JS")  # read the JavaScript source inside Link object
    # then do as above

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
1 reply
@immartyn
Comment options

Comment options

You must be logged in to vote
6 replies
@JorjMcKie
Comment options

@immartyn
Comment options

@JorjMcKie
Comment options

@immartyn
Comment options

@JorjMcKie
Comment options

Comment options

You must be logged in to vote
1 reply
@immartyn
Comment options

Answer selected by immartyn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants