- [placeholder-pdfkit, placeholder-pdfkit010, placeholder-plain] Fixed how
appNameis written to signature metadata. Names containing spaces, PDF delimiters, or non-ASCII characters now round-trip correctly. - [utils] Added
escapePdfName()to encode a string for use as a PDF name. - Updated the Yarn lockfile for
node-forge(1.4.3),follow-redirects(1.16.2),form-data(3.0.5),brace-expansion(1.1.21), andbrowserslist(4.29.3). Migrated repository linting to ESLint 9.
- Breaking: Raised the minimum supported Node.js version from 12 to 22. Applications on older Node.js versions can continue using 3.4.0.
- [utils] Fix
extractSignature()corrupting signatures that end in zero bytes by reading the DER-encoded length instead of stripping trailing zero bytes; - [placeholder-pdf-lib] Preserve Unicode characters in signature
reason,contactInfo,nameandlocation; - [placeholder-pdfkit] Expand the PDFKit peer dependency range to
>=0.11.0 <0.16.0, with compatibility checks for PDFKit 0.11 through 0.15; - [placeholder-pdfkit, placeholder-pdfkit010] Restore full test coverage and enforce coverage thresholds;
- Bumped dependencies (node-forge, axios, follow-redirects, lodash, picomatch, handlebars, flatted, diff, ws, @babel/core, @babel/plugin-transform-modules-systemjs, @tootallnate/once, baseline-browser-mapping).
- [placeholder-plain] Decouple from placeholder-pdfkit010 and pdfkit
- Bumped dependencies (@babel/runtime, @babel/helpers, node-forge)
- [placeholder-pdf-lib] Fix AcroForm
/Fieldshandling
- [placeholder-pdfkit010] Fixed an issue with parsing
/Fields withsurrounding spaces. - Bumped version of follow-redirects, ejs, braces, ws, cross-spawn, micromatch, axios
- [placeholder-pdf-lib] Fix typing for
pdf-lib'sPDFPage. - [placeholder-pdf-lib] Correctly noted that either
pdfDocorpdfPageis required, not both. - Introduced
tsdto verify the types that we generate.
- [examples] Run linting on examples;
- [placeholder-plain] Fix ability to add a placeholder to a file that contains the "trailer" keyword in plain text;
- Bumped version of ip, punycode and sshpk.
- Zero-change version. Lerna versioning was messed up with
lerna publish from-package.
- [signer-p12] Fixed JSDoc on the sign() method.
-
[utils] Introduced
convertBuffer()to allow inputs asBuffer,Uint8Arrayorstring; -
[utils] The
Signerabstract class accepts an optionalsigningTime; -
[utils]
removeTrailingNewLinewould works for files with\r,\nor\r\n; -
[signpdf] Accepts
Buffer,Uint8Arrayorstringas input; -
[signer-p12] Accepts
Buffer,Uint8Arrayorstringas input; -
[signer-p12] Respects
signingTimeas abstracted inSigner; -
[placeholder-pdf-lib] Accepts either a
PDFDocor aPDFPageto allow adding the placeholder to a specific page rather than always the first one; -
[placeholder-pdf-lib] Accepts
signingTime; -
[placeholder-pdf-lib] Includes an
APappearance stream for PDF/A compliance; -
[placeholder-pdf-lib] Accepts
appNameand includes it inProp_Buildto allow describing the signing application; -
[placeholder-pdf-lib] Does not require
{useObjectStreams: false}; -
[placeholder-pdfkit] Accepts
signingTime; -
[placeholder-pdfkit] Accepts
appNameand includes it inProp_Buildto allow describing the signing application; -
[placeholder-pdfkit010] Accepts
signingTime; -
[placeholder-pdfkit010] Accepts
appNameand includes it inProp_Buildto allow describing the signing application; -
[placeholder-plain] Accepts
signingTime; -
[placeholder-plain] Accepts
appNameand includes it inProp_Buildto allow describing the signing application; -
Bumped version of follow-redirects;
- [placeholder-pdfkit] Introduce the package that uses PDFKit > 0.10 for adding a placeholder;
- [utils] Added
SIG_FLAGSandANNOTATION_FLAGSto improve readability; - [utils] Reworked
findByteRangeto match in more cases where it was incompatible so far (it didn't allow optional spaces in the array). - [placeholder-pdfkit010] Uses
SIG_FLAGSandANNOTATION_FLAGSinstead of magic numbers; - [placeholder-pdfkit010] Allow passing in
widgetRectto override the default[0, 0, 0, 0]one; - [placeholder-plain] Allow passing in
widgetRectto override the default[0, 0, 0, 0]one; - [placeholder-pdf-lib] Introduce the package that uses PDF-LIB for adding a placeholder;
- [signpdf] Use the BR position
findByteRangeprovides to spare a search for it; - [signpdf] Reexports the
Signerbase (abstract) class andSignPdfError; - [examples] Introduce an example that provides a visible widget (implemented with pdfkit);
- [examples] Introduce a
placeholder-pdf-libexample; - Bumped version of axios;
- Deprecating
node-signpdfto be replaced by the@signpdfscoped packages; - Split the helpers into separate packages
@signpdf/placeholder-pdfkit010and@signpdf/placeholder-plain; - Decoupled the signing algorythm and the PDF signing process. Now
@signpdf/signpdfunderstands PDFs and@signpdf/signer-p12understands P12 andnode-forge; - sign() is now async to allow for hooking different signers;
- placeholder helpers now require
contactInfo,locationandnamewhich used to be optional; - Introduced examples in
packages/examples; - Introduced more types declarations through TS and JSDoc;
- Only publish dist files into npm (see https://bit.ly/46rykd7 on why this requires a major version);
- Produce and publish .d.ts;
- Bumped versions of semver and word-wrap;
- Reorder authenticatedAttributes so that EU's verification passes;
- Reworked reading xref table;
- Shifted minimum Node from 10 to 12;
- Added Husky;
- Upgraded dependencies;
- Added support for overriding signature SubFilter value allowing the creation of PAdES compliant signatures;
- Added linting to CI;
- Bump dependencies;
- Removed Travis integration in favor of GitHub Actions;
- plainAddPlaceholder: Fixed loss of PDF metadata when adding placeholder;
- Export helpers from root;
- Bumped dependencies;
- Fixed detection of ByteRange (including when it is a placeholder);
- Bumped node-forge version;
- Allow pdfkitAddPlaceholder to receive custom location, contactInfo, name;
- Fixed duplicate startxref in some PDFs;
- Fixed AcroForm ID extraction;
- Updated dependencies;
- Fixed the opposite of 1.2.2's fix: adding placeholder failed when there were no previous /Annots.
- Fixed an issue in plainAddPlaceholder that used to fail when the source PDF already contained /Annots.
- Fixed the logo for display in npmjs.com.
removeTrailingNewLineremoves both\rand\n.- Simplified regex that finds page dictionary ref.
- Introduced the logo.
plainAddPlaceholdercreates an incremental change to allow signing a document multiple times.
- Republish to fix messed up
latesttag
- Removed signature verification as it is an incomplete implementation
- Split helpers as they became a huge piece of code
- Renamed
addSignaturePlaceholdertopdfkitAddPlaceholder - Implemented
plainAddPlaceholderthat works without pdfkit but with string/Buffer operations instead - Started this CHNAGELOG
- Switched from npm to yarn
- Upgraded dependencies due to vulnerabilities
- Fixed the ByteRange-matching regex
- Fixed ByteRange logic in extractSignature
- Updated the way the page dictionary is refernced to make it work with both pdfkit 0.8 and 0.9
- Upgraded dependencies due to vulnerabilities
- Added signature verification
- Extracted helpers out to make them reusable