1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-28 23:28:16 +02:00

Don't get the text content for an annotation when /NeedAppearances is true (bug 1844583)

When the flag is set, the appearance has to be generated from the value so it's
useless/meaningless to extract the content from the existing appearance.
This commit is contained in:
Calixte Denizet 2023-07-21 10:28:03 +02:00
parent 1a69b6ad64
commit d470e91223
4 changed files with 178 additions and 1 deletions

View file

@ -508,4 +508,32 @@ describe("ResetForm action", () => {
});
});
});
describe("Don't use AP when /NeedAppearances is true", () => {
describe("bug1844583.pdf", () => {
let pages;
beforeAll(async () => {
pages = await loadAndWait(
"bug1844583.pdf",
"[data-annotation-id='8R']"
);
});
afterAll(async () => {
await closePages(pages);
});
it("must check the content of the text field", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
const text = await page.$eval(getSelector("8R"), el => el.value);
expect(text)
.withContext(`In ${browserName}`)
.toEqual("Hello World");
})
);
});
});
});
});