Skip to content

Commit 10a1db6

Browse files
Merge pull request #13824 from Snuffleupagus/issue-13823
When no "V" entry exists, let the fieldValue fallback to the "DV" entry (issue 13823)
2 parents 67f4c34 + ff71be7 commit 10a1db6

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/core/annotation.js

+6
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,12 @@ class WidgetAnnotation extends Annotation {
11931193
});
11941194
data.defaultFieldValue = this._decodeFormValue(defaultFieldValue);
11951195

1196+
// When no "V" entry exists, let the fieldValue fallback to the "DV" entry
1197+
// (fixes issue13823.pdf).
1198+
if (fieldValue === undefined && data.defaultFieldValue !== null) {
1199+
data.fieldValue = data.defaultFieldValue;
1200+
}
1201+
11961202
data.alternativeText = stringToPDFString(dict.get("TU") || "");
11971203

11981204
const defaultAppearance =

test/pdfs/issue13823.pdf.link

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/mozilla/pdf.js/files/6907771/Formular_T_default.pdf

test/test_manifest.json

+8
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,14 @@
10461046
"enableXfa": true,
10471047
"type": "eq"
10481048
},
1049+
{ "id": "issue13823",
1050+
"file": "pdfs/issue13823.pdf",
1051+
"md5": "8ca53bba9b2c68f5cd87f13a963e6b6a",
1052+
"rounds": 1,
1053+
"link": true,
1054+
"type": "eq",
1055+
"forms": true
1056+
},
10491057
{ "id": "xfa_bug1718521_1",
10501058
"file": "pdfs/xfa_bug1718521_1.pdf",
10511059
"md5": "9b89dd9e6a4c6c3258ca24debd806863",

0 commit comments

Comments
 (0)