Annotation - For checkboxes, get field value from AS (if any) instead of V (bug 1722036)
- it aims to fix https://bugzilla.mozilla.org/show_bug.cgi?id=1722036. - AS and V should share the same value for checkbox: it's at least what the specs say; - the pdf in the above bug opens correctly in Acrobat so it likely means that AS is chosen over V.
This commit is contained in:
parent
d6a27860e3
commit
5bef8120e7
@ -2083,6 +2083,13 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1722036.
|
||||||
|
// If we've an AS and a V then take AS.
|
||||||
|
const asValue = this._decodeFormValue(params.dict.get("AS"));
|
||||||
|
if (typeof asValue === "string") {
|
||||||
|
this.data.fieldValue = asValue;
|
||||||
|
}
|
||||||
|
|
||||||
const exportValues = normalAppearance.getKeys();
|
const exportValues = normalAppearance.getKeys();
|
||||||
if (!exportValues.includes("Off")) {
|
if (!exportValues.includes("Off")) {
|
||||||
// The /Off appearance is optional.
|
// The /Off appearance is optional.
|
||||||
|
1
test/pdfs/bug1722036.pdf.link
Normal file
1
test/pdfs/bug1722036.pdf.link
Normal file
@ -0,0 +1 @@
|
|||||||
|
https://bugzilla.mozilla.org/attachment.cgi?id=9232845
|
@ -5899,5 +5899,13 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"lastPage": 1,
|
"lastPage": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
|
},
|
||||||
|
{ "id": "bug1722036",
|
||||||
|
"file": "pdfs/bug1722036.pdf",
|
||||||
|
"md5": "bbc7f62ca85609c97069bd3ce2658288",
|
||||||
|
"rounds": 1,
|
||||||
|
"link": true,
|
||||||
|
"forms": true,
|
||||||
|
"type": "eq"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user