From 49a098cb5d626d1e85c16f3f1a12a2b3ec7fd593 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Fri, 9 May 2025 21:46:17 +0200 Subject: [PATCH] Decode appearance keys of checkboxes --- src/core/annotation.js | 2 +- test/pdfs/issue19753.pdf.link | 1 + test/test_manifest.json | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/pdfs/issue19753.pdf.link diff --git a/src/core/annotation.js b/src/core/annotation.js index b6106fbee..8ef4e335c 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -3290,7 +3290,7 @@ class ButtonWidgetAnnotation extends WidgetAnnotation { ? this.data.fieldValue : "Yes"; - const exportValues = normalAppearance.getKeys(); + const exportValues = this._decodeFormValue(normalAppearance.getKeys()); if (exportValues.length === 0) { exportValues.push("Off", yes); } else if (exportValues.length === 1) { diff --git a/test/pdfs/issue19753.pdf.link b/test/pdfs/issue19753.pdf.link new file mode 100644 index 000000000..2bd70b19d --- /dev/null +++ b/test/pdfs/issue19753.pdf.link @@ -0,0 +1 @@ +https://github.com/user-attachments/files/19566810/PDFjs_fails_checkboxState.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index 99e6f53bd..71d7d8551 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -12114,5 +12114,14 @@ "md5": "2abe67c8b34522feb6b85d252dde9d3e", "rounds": 1, "type": "eq" + }, + { + "id": "issue19753", + "file": "pdfs/issue19753.pdf", + "md5": "6b1fe0af506860002a9411f5f0d6437f", + "rounds": 1, + "type": "eq", + "forms": true, + "link": true } ]