Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation - For checkboxes, get field value from AS (if any) instead of V (bug 1722036) #14035

Merged
merged 1 commit into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/core/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2083,6 +2083,13 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
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();
if (!exportValues.includes("Off")) {
// The /Off appearance is optional.
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/bug1722036.pdf.link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://bugzilla.mozilla.org/attachment.cgi?id=9232845
8 changes: 8 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5899,5 +5899,13 @@
"rounds": 1,
"lastPage": 1,
"type": "eq"
},
{ "id": "bug1722036",
"file": "pdfs/bug1722036.pdf",
"md5": "bbc7f62ca85609c97069bd3ce2658288",
"rounds": 1,
"link": true,
"forms": true,
"type": "eq"
}
]