WebViewer Version:
8.9
Do you have an issue with a specific file(s)?
No
Can you reproduce using one of our samples or online demos?
Are you using the WebViewer server?
No
Does the issue only happen on certain browsers?
No
Is your issue related to a front-end framework?
No
Is your issue related to annotations?
No
Please give a brief summary of your issue:
(Think of this as an email subject)
Whan 2nd parameter of setFieldPermissions
is added a type error is thrown.
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
Please code snippet and result below
await PDFNet.runWithCleanup(async () => {
// lock the document before a write operation
// runWithCleanup will auto unlock when complete
doc.initSecurityHandler();
doc.lock();
const hasSigs = await doc.hasSignatures();
console.log('- has signature?', hasSigs);
const page1 = await doc.getPage(1);
logger.log('-----------------approval sig-----------------');
const approvalSignatureField = await doc.createDigitalSignatureField(
'PDFTronApprovalSig' + sigString
);
const widgetAnnotApproval =
await PDFNet.SignatureWidget.createWithDigitalSignatureField(
doc,
new PDFNet.Rect(0, 100, 200, 150),
approvalSignatureField
);
await approvalSignatureField.setFieldPermissions(
PDFNet.DigitalSignatureField.FieldPermissions.e_include,
[]
);
if (!hasSigs) {
await approvalSignatureField.setDocumentPermissions(
PDFNet.DigitalSignatureField.DocumentPermissions
.e_annotating_formfilling_signing_allowed
);
}
await page1.annotPushBack(widgetAnnotApproval);
}, '1');