diff --git a/src/core/annotation.js b/src/core/annotation.js index 7fce8cc3cf6079..197012cd3deea7 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -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 = diff --git a/test/pdfs/issue13823.pdf.link b/test/pdfs/issue13823.pdf.link new file mode 100644 index 00000000000000..040436b9a2ee11 --- /dev/null +++ b/test/pdfs/issue13823.pdf.link @@ -0,0 +1 @@ +https://github.com/mozilla/pdf.js/files/6907771/Formular_T_default.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index aca8124dc8948f..9c2325b4c3cb80 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -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",