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

Get urls if any in AA::D dictionary for pushbuttons

This commit is contained in:
Calixte Denizet 2020-10-15 19:42:36 +02:00
parent a373137304
commit ce3d3a6ff8
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)) {