1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Merge pull request #12481 from calixteman/issue_12475

Get urls if any in AA::D dictionary for pushbuttons
This commit is contained in:
Tim van der Meij 2020-10-16 22:55:43 +02:00 committed by GitHub
commit ff2631493e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 80 additions and 6 deletions

View file

@ -1165,10 +1165,23 @@ class Catalog {
let action = destDict.get("A"),
url,
dest;
if (!isDict(action) && destDict.has("Dest")) {
// A /Dest entry should *only* contain a Name or an Array, but some bad
// PDF generators ignore that and treat it as an /A entry.
action = destDict.get("Dest");
if (!isDict(action)) {
if (destDict.has("Dest")) {
// A /Dest entry should *only* contain a Name or an Array, but some bad
// PDF generators ignore that and treat it as an /A entry.
action = destDict.get("Dest");
} else {
action = destDict.get("AA");
if (isDict(action)) {
if (action.has("D")) {
// MouseDown
action = action.get("D");
} else if (action.has("U")) {
// MouseUp
action = action.get("U");
}
}
}
}
if (isDict(action)) {