From 35a58ed9871159d5f46a33037c3d480b39824ce5 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Thu, 25 May 2023 22:59:09 +0200 Subject: [PATCH] Extract all the text of text annotations --- src/core/document.js | 7 ++++++- test/pdfs/issue16471.pdf.link | 1 + test/test_manifest.json | 9 +++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 test/pdfs/issue16471.pdf.link diff --git a/src/core/document.js b/src/core/document.js index 994df897c..93f31b795 100644 --- a/src/core/document.js +++ b/src/core/document.js @@ -614,7 +614,12 @@ class Page { textContentPromises.push( annotation - .extractTextContent(partialEvaluator, task, this.view) + .extractTextContent(partialEvaluator, task, [ + -Infinity, + -Infinity, + Infinity, + Infinity, + ]) .catch(function (reason) { warn( `getAnnotationsData - ignoring textContent during "${task.name}" task: "${reason}".` diff --git a/test/pdfs/issue16471.pdf.link b/test/pdfs/issue16471.pdf.link new file mode 100644 index 000000000..4f7ef270a --- /dev/null +++ b/test/pdfs/issue16471.pdf.link @@ -0,0 +1 @@ +https://github.com/mozilla/pdf.js/files/11568812/test2.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index ee6d7d7d5..2c159458b 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -7667,5 +7667,14 @@ "link": true, "print": true, "type": "eq" + }, + { + "id": "issue16471", + "file": "pdfs/issue16471.pdf", + "md5": "8ac3720d6d3ddcc58e2eadab477fd81e", + "rounds": 1, + "link": true, + "forms": true, + "type": "eq" } ]