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

Display widget signature

- but don't validate them for now;
  - Firefox will display a bar to warn that the signature validation is not supported (see https://bugzilla.mozilla.org/show_bug.cgi?id=854315)
  - almost all (all ?) pdf readers display signatures;
  - validation is done in edge but for now it's behind a pref.
This commit is contained in:
Calixte Denizet 2021-04-10 16:53:17 +02:00
parent 6ddc297170
commit 5875ebb1ca
10 changed files with 58 additions and 19 deletions

View file

@ -85,6 +85,7 @@
!issue9458.pdf
!issue9655_reduced.pdf
!issue9915_reduced.pdf
!bug854315.pdf
!issue9940.pdf
!issue10388_reduced.pdf
!issue10438_reduced.pdf

BIN
test/pdfs/bug854315.pdf Normal file

Binary file not shown.

View file

@ -389,6 +389,12 @@
"rounds": 1,
"type": "load"
},
{ "id": "bug854315",
"file": "pdfs/bug854315.pdf",
"md5": "675754c07f71c068d2997905a5456f05",
"rounds": 1,
"type": "eq"
},
{ "id": "bug868745",
"file": "pdfs/bug868745.pdf",
"md5": "86111ea5097dd7daffcdea891ad1b348",

View file

@ -1212,6 +1212,7 @@ describe("api", function () {
expect(info.IsAcroFormPresent).toEqual(false);
expect(info.IsXFAPresent).toEqual(false);
expect(info.IsCollectionPresent).toEqual(false);
expect(info.IsSignaturesPresent).toEqual(false);
expect(metadata instanceof Metadata).toEqual(true);
expect(metadata.get("dc:title")).toEqual("Basic API Test");
@ -1254,6 +1255,7 @@ describe("api", function () {
expect(info.IsAcroFormPresent).toEqual(false);
expect(info.IsXFAPresent).toEqual(false);
expect(info.IsCollectionPresent).toEqual(false);
expect(info.IsSignaturesPresent).toEqual(false);
expect(metadata).toEqual(null);
expect(contentDispositionFilename).toEqual(null);
@ -1282,6 +1284,7 @@ describe("api", function () {
expect(info.IsAcroFormPresent).toEqual(false);
expect(info.IsXFAPresent).toEqual(false);
expect(info.IsCollectionPresent).toEqual(false);
expect(info.IsSignaturesPresent).toEqual(false);
expect(metadata).toEqual(null);
expect(contentDispositionFilename).toEqual(null);

View file

@ -77,6 +77,7 @@ describe("document", function () {
const pdfDocument = getDocument(null);
expect(pdfDocument.formInfo).toEqual({
hasAcroForm: false,
hasSignatures: false,
hasXfa: false,
hasFields: false,
});
@ -90,6 +91,7 @@ describe("document", function () {
let pdfDocument = getDocument(acroForm);
expect(pdfDocument.formInfo).toEqual({
hasAcroForm: false,
hasSignatures: false,
hasXfa: false,
hasFields: false,
});
@ -98,6 +100,7 @@ describe("document", function () {
pdfDocument = getDocument(acroForm);
expect(pdfDocument.formInfo).toEqual({
hasAcroForm: false,
hasSignatures: false,
hasXfa: true,
hasFields: false,
});
@ -106,6 +109,7 @@ describe("document", function () {
pdfDocument = getDocument(acroForm);
expect(pdfDocument.formInfo).toEqual({
hasAcroForm: false,
hasSignatures: false,
hasXfa: false,
hasFields: false,
});
@ -114,6 +118,7 @@ describe("document", function () {
pdfDocument = getDocument(acroForm);
expect(pdfDocument.formInfo).toEqual({
hasAcroForm: false,
hasSignatures: false,
hasXfa: true,
hasFields: false,
});
@ -127,6 +132,7 @@ describe("document", function () {
let pdfDocument = getDocument(acroForm);
expect(pdfDocument.formInfo).toEqual({
hasAcroForm: false,
hasSignatures: false,
hasXfa: false,
hasFields: false,
});
@ -135,6 +141,7 @@ describe("document", function () {
pdfDocument = getDocument(acroForm);
expect(pdfDocument.formInfo).toEqual({
hasAcroForm: true,
hasSignatures: false,
hasXfa: false,
hasFields: true,
});
@ -146,6 +153,7 @@ describe("document", function () {
pdfDocument = getDocument(acroForm);
expect(pdfDocument.formInfo).toEqual({
hasAcroForm: true,
hasSignatures: false,
hasXfa: false,
hasFields: true,
});
@ -169,6 +177,7 @@ describe("document", function () {
pdfDocument = getDocument(acroForm, xref);
expect(pdfDocument.formInfo).toEqual({
hasAcroForm: false,
hasSignatures: true,
hasXfa: false,
hasFields: true,
});