Signers
To digitaly sign a document you must define a signer first.
In the picture below we have an example how to define a signer for .pdf file format. Signing is implemented using node-signpdf
library from www.npmjs.com repository (see how to install module from NPM in Module Manager).
After defining a signer for a certain file type, you will get Sign
command in the context menu of FilesView
control (see image below).
Signer will use a certificate assigned to currently logged user. In the case when logged user has more than one certificate, Select Certificate
window will be shown. How to manage user certificates you can find here.
To sign a .pdf file in your code, you can directly call matching signer. For example:
const { pdf } = await import('nv:SystemManagement.Signers.pdf');
...
var cert = <select one certificate from env.certificates>;
await pdf.sign(inFilePath, outSignedFilePath, cert);
Hint
You can access all certificates available to logged user via env.certificates
.