PdfCertificationFlags
16 Dec 20251 minute to read
Specifies the certification flags.
//Load the document
let document: PdfDocument = new PdfDocument(data);
// Gets the first page of the document
let page: PdfPage = document.getPage(0);
// Access the PDF form
let form: PdfForm = document.form;
// Create a new signature field
let field: PdfSignatureField = new PdfSignatureField(page, 'Signature', {x: 10, y: 10, width: 100, height: 50});
// Create a new signature using PFX data and specify forbidchanges as the certification flags
const sign: PdfSignature = PdfSignature.create({ documentPermissions: PdfCertificationFlags.forbidChanges }, certData, password);
// Sets the signature to the field
field.setSignature(sign);
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();-
allowComments- Only allow commenting and form fill-in actions on this document. -
allowFormFill- Only allow form fill-in actions on this document. -
forbidChanges- Restrict any changes to the document.