@npdevind/esigntick
v1.1.3
Published
Open-source PDF digital-signature library for Node.js — PAdES/CMS signing with PFX and PEM certificates. Visible signature stamp, green-tick appearance, configurable layout. No license keys, no native addons, no legal risk.
Downloads
1,204
Maintainers
Readme
ind
@npdevind/esigntick
Open-source PDF digital-signature library for Node.js — PAdES/CMS signing with PFX and PEM certificates. Visible signature stamp, green-tick appearance, configurable layout.
No license keys. No native addons. No legal risk. MIT Licensed.
Install
npm install @npdevind/esigntickPure JavaScript — no node-gyp, no compiler, no postinstall scripts.
Quick Start
import { signPfx } from "@npdevind/esigntick";
import { readFileSync, writeFileSync } from "fs";
const signed = await signPfx(readFileSync("doc.pdf"), readFileSync("my.pfx"), {
password: "••••",
cn: "My Organization",
reason: "Approved",
location: "India",
green_tick: true,
pades: true,
page: 1,
rect: [380, 30, 565, 80],
});
writeFileSync("signed.pdf", signed);Features
| Feature | Details |
| ------------------- | ------------------------------------------------------------- |
| PFX/P12 signing | .pfx, .p12 certificates with password |
| PEM signing | .pem certificate + private key (combined or separate files) |
| Auto-detect | sign() detects cert format automatically |
| Visible stamp | Green tick icon + signer info text on the PDF |
| Custom body | *bold* markers, \n line breaks |
| PAdES-B-B | "pades": true for ETSI CAdES detached |
| Configurable | Font size, colors, position, custom mark color |
| MIT License | No license keys, no activation, no legal notices |
API
signPfx(pdf, pfx, options)
Sign with a PFX/P12 certificate.
const signed = await signPfx(pdfBuffer, pfxBuffer, options);signPem(pdf, pem, options, keyBuffer?)
Sign with PEM certificate. If the key is in a separate file, pass it as the 4th argument.
// Combined PEM (cert + key in one file)
const signed = await signPem(pdfBuffer, pemBuffer, options);
// Separate PEM files
const signed = await signPem(pdfBuffer, certPem, options, keyPem);sign(pdf, cert, options, keyBuffer?)
Auto-detect certificate format and sign accordingly.
const signed = await sign(pdfBuffer, certBuffer, options);version()
Returns the package version string.
Options
All options can be passed as a plain object or as a JSON string.
| Option | Type | Default | Description |
| --------------- | --------------- | --------------------- | ----------------------------------------------- |
| password | string | '' | PFX/P12 password |
| cn | string | from cert | Common Name (signer display name) |
| reason | string | 'Digital Signature' | Signing reason |
| location | string | '' | Signing location |
| org | string | from cert | Organization name |
| page | number | last page | Target page (1-indexed) |
| rect | [x1,y1,x2,y2] | bottom-right | Signature rectangle in PDF points |
| body | string | auto | Custom stamp text (*bold*, \n for newlines) |
| date | string | current time | Custom date string for stamp |
| green_tick | boolean | true | Show green checkmark icon |
| pades | boolean | false | PAdES-B-B compliance |
| hash_algo | string | 'sha256' | Hash algorithm |
| font_size | number | 7 | Stamp text font size |
| text_color | string | '#1a1a2e' | Stamp text color (hex) |
| bg_color | string | '#FFFFFF' | Stamp background color (hex) |
| mark_color | string | '#22C55E' | Green tick color (hex) |
| border | boolean | true | Show stamp border |
| field_name | string | auto | Signature field name |
| contents_size | number | 8192 | Signature container size |
Custom Body Text
Use the body option for fully custom stamp text:
{
body: "*GOVT OF WEST BENGAL*\\nDirectorate of Legal Metrology\\nAuth: *Inspector*\\nDate: 03/07/2026";
}*text*renders as bold\ncreates a new line
JSON string options are also supported:
const signed = await signPfx(
pdf,
pfx,
JSON.stringify({ password: "1234", cn: "Org", pades: true }),
);Dependencies
All dependencies are permissively licensed (MIT/BSD/ISC):
| Package | License | Purpose |
| ---------------------------- | ------- | ---------------------------------- |
| pdf-lib | MIT | PDF manipulation & stamp rendering |
| node-forge | BSD-3 | Certificate parsing & crypto |
| @signpdf/signpdf | MIT | PKCS#7/CMS signature injection |
| @signpdf/signer-p12 | MIT | PFX/P12 signer |
| @signpdf/placeholder-plain | MIT | Signature placeholder |
Zero copyleft risk. Safe for closed-source, commercial, and government projects.
License
MIT © 2026 npdevind
