Skip to content

Commit

Permalink
When no "V" entry exists, let the fieldValue fallback to the "DV" ent…
Browse files Browse the repository at this point in the history
…ry (issue 13823)
  • Loading branch information
Snuffleupagus authored and pull[bot] committed Feb 20, 2024
1 parent 694ad11 commit 1875357
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,12 @@ class WidgetAnnotation extends Annotation {
});
data.defaultFieldValue = this._decodeFormValue(defaultFieldValue);

// When no "V" entry exists, let the fieldValue fallback to the "DV" entry
// (fixes issue13823.pdf).
if (fieldValue === undefined && data.defaultFieldValue !== null) {
data.fieldValue = data.defaultFieldValue;
}

data.alternativeText = stringToPDFString(dict.get("TU") || "");

const defaultAppearance =
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/issue13823.pdf.link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/mozilla/pdf.js/files/6907771/Formular_T_default.pdf
8 changes: 8 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,14 @@
"enableXfa": true,
"type": "eq"
},
{ "id": "issue13823",
"file": "pdfs/issue13823.pdf",
"md5": "8ca53bba9b2c68f5cd87f13a963e6b6a",
"rounds": 1,
"link": true,
"type": "eq",
"forms": true
},
{ "id": "xfa_bug1718521_1",
"file": "pdfs/xfa_bug1718521_1.pdf",
"md5": "9b89dd9e6a4c6c3258ca24debd806863",
Expand Down

0 comments on commit 1875357

Please sign in to comment.