mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-24 09:08:07 +02:00
Take into account empty lines when extracting text content from the appearance
Fixes #17492.
This commit is contained in:
parent
0d011472a4
commit
405f573d70
4 changed files with 19 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue