Take into account empty lines when extracting text content from the appearance
Fixes #17492.
This commit is contained in:
parent
0d011472a4
commit
405f573d70
@ -2816,6 +2816,10 @@ class PartialEvaluator {
|
||||
}
|
||||
}
|
||||
|
||||
if (keepWhiteSpace) {
|
||||
compareWithLastPosition(0);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -624,3 +624,4 @@
|
||||
!bug1871353.pdf
|
||||
!bug1871353.1.pdf
|
||||
!file_pdfjs_form.pdf
|
||||
!issue17492.pdf
|
||||
|
BIN
test/pdfs/issue17492.pdf
Normal file
BIN
test/pdfs/issue17492.pdf
Normal file
Binary file not shown.
@ -2550,6 +2550,20 @@ describe("api", function () {
|
||||
await loadingTask.destroy();
|
||||
});
|
||||
|
||||
it("read content from multiline textfield containing an empty line", async function () {
|
||||
const loadingTask = getDocument(buildGetDocumentParams("issue17492.pdf"));
|
||||
const pdfDoc = await loadingTask.promise;
|
||||
const pdfPage = await pdfDoc.getPage(1);
|
||||
const annotations = await pdfPage.getAnnotations();
|
||||
|
||||
const field = annotations.find(annotation => annotation.id === "144R");
|
||||
expect(!!field).toEqual(true);
|
||||
expect(field.fieldValue).toEqual("Several\n\nOther\nJobs");
|
||||
expect(field.textContent).toEqual(["Several", "", "Other", "Jobs"]);
|
||||
|
||||
await loadingTask.destroy();
|
||||
});
|
||||
|
||||
describe("Cross-origin", function () {
|
||||
let loadingTask;
|
||||
function _checkCanLoad(expectSuccess, filename, options) {
|
||||
|
Loading…
Reference in New Issue
Block a user