node-signpdf


Simple signing of PDFs in node.
Usage
See Signing PDF in simple steps
Notes
Signing PDF in simple steps
Generate a PDF
In the test PDFKit is used for generating the PDF. This also allows easy addition of the signature placeholder.
Append a signature placeholder
What's needed is a Sig
element and a Widget
that is also linked in a Form
. The form needs to be referenced in the root descriptor of the PDF as well. A readable sample is available in the test.
Generate and apply signature
That's where node-signpdf
kicks in. Given a PDF and a P12 certificate a signature is generated in detached mode and is replaced in the placeholder. This is best demonstrated in the tests.
Dependencies
node-forge is used for working with signatures.
PDFKit is used in the tests for generating a PDF with a signature placeholder.
Credits
The whole signing flow is a rework of what's already in pdfsign.js so thanks go to @tbocek