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

[api-minor] Implement securityHandler in the scripting API (bug 1731578)

This commit is contained in:
Jane-Kotovich 2021-10-26 00:09:26 +10:00
parent 1ab9a6e36e
commit 91fc643ff9
7 changed files with 32 additions and 1 deletions

View file

@ -896,4 +896,26 @@ describe("Interaction", () => {
);
});
});
describe("in secHandler.pdf", () => {
let pages;
beforeAll(async () => {
pages = await loadAndWait("secHandler.pdf", "#\\32 5R");
});
afterAll(async () => {
await closePages(pages);
});
it("must print securityHandler value in a text field", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
const text = await actAndWaitForInput(page, "#\\32 5R", async () => {
await page.click("[data-annotation-id='26R']");
});
expect(text).withContext(`In ${browserName}`).toEqual("Standard");
})
);
});
});
});

View file

@ -477,3 +477,4 @@
!issue12337.pdf
!pr12564.pdf
!pr12828.pdf
!secHandler.pdf

BIN
test/pdfs/secHandler.pdf Normal file

Binary file not shown.

View file

@ -1166,6 +1166,7 @@ describe("api", function () {
// The following are PDF.js specific, non-standard, properties.
expect(info.PDFFormatVersion).toEqual("1.7");
expect(info.Language).toEqual("en");
expect(info.EncryptFilterName).toEqual(null);
expect(info.IsLinearized).toEqual(false);
expect(info.IsAcroFormPresent).toEqual(false);
expect(info.IsXFAPresent).toEqual(false);
@ -1201,6 +1202,7 @@ describe("api", function () {
// The following are PDF.js specific, non-standard, properties.
expect(info.PDFFormatVersion).toEqual("1.4");
expect(info.Language).toEqual(null);
expect(info.EncryptFilterName).toEqual(null);
expect(info.IsLinearized).toEqual(false);
expect(info.IsAcroFormPresent).toEqual(false);
expect(info.IsXFAPresent).toEqual(false);
@ -1223,6 +1225,7 @@ describe("api", function () {
// The following are PDF.js specific, non-standard, properties.
expect(info.PDFFormatVersion).toEqual(null);
expect(info.Language).toEqual(null);
expect(info.EncryptFilterName).toEqual(null);
expect(info.IsLinearized).toEqual(false);
expect(info.IsAcroFormPresent).toEqual(false);
expect(info.IsXFAPresent).toEqual(false);