mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Merge pull request #13214 from calixteman/signatures
Display widget signature
This commit is contained in:
commit
d9d626a5e1
10 changed files with 58 additions and 19 deletions
|
@ -848,7 +848,12 @@ class PDFDocument {
|
|||
}
|
||||
|
||||
get formInfo() {
|
||||
const formInfo = { hasFields: false, hasAcroForm: false, hasXfa: false };
|
||||
const formInfo = {
|
||||
hasFields: false,
|
||||
hasAcroForm: false,
|
||||
hasXfa: false,
|
||||
hasSignatures: false,
|
||||
};
|
||||
const acroForm = this.catalog.acroForm;
|
||||
if (!acroForm) {
|
||||
return shadow(this, "formInfo", formInfo);
|
||||
|
@ -874,9 +879,11 @@ class PDFDocument {
|
|||
// the first bit of the `SigFlags` integer (see Table 219 in the
|
||||
// specification).
|
||||
const sigFlags = acroForm.get("SigFlags");
|
||||
const hasSignatures = !!(sigFlags & 0x1);
|
||||
const hasOnlyDocumentSignatures =
|
||||
!!(sigFlags & 0x1) && this._hasOnlyDocumentSignatures(fields);
|
||||
hasSignatures && this._hasOnlyDocumentSignatures(fields);
|
||||
formInfo.hasAcroForm = hasFields && !hasOnlyDocumentSignatures;
|
||||
formInfo.hasSignatures = hasSignatures;
|
||||
} catch (ex) {
|
||||
if (ex instanceof MissingDataException) {
|
||||
throw ex;
|
||||
|
@ -914,6 +921,7 @@ class PDFDocument {
|
|||
IsAcroFormPresent: this.formInfo.hasAcroForm,
|
||||
IsXFAPresent: this.formInfo.hasXfa,
|
||||
IsCollectionPresent: !!this.catalog.collection,
|
||||
IsSignaturesPresent: this.formInfo.hasSignatures,
|
||||
};
|
||||
|
||||
let infoDict;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue