Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@signpdf/placeholder-pdf-lib

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@signpdf/placeholder-pdf-lib

Use PDF-LIB to insert a signature placeholder.

  • 3.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.8K
increased by48.16%
Maintainers
1
Weekly downloads
 
Created
Source

Helper that provides placeholder using PDF-LIB

for @signpdf

npm version

Works with PDF-LIB and given a PDFDocument that is in the works, adds an e-signature placeholder. When the PDF is ready you can convert it to Buffer and pass it to @signpdf/signpdf to complete the process.

Usage

You will need $ npm i -S @signpdf/placeholder-pdf-lib pdf-lib @signpdf/signpdf node-forge and a look at the pdf-lib.js example.

Notes

  • Make sure to have a look at the docs of the @signpdf family of packages.
  • Feel free to copy and paste any part of this code. See its defined Purpose.

Signature length

Signing in detached mode makes the signature length independent of the PDF's content length, but it may still vary between different signing certificates. So every time you sign using the same P12 you will get the same length of the output signature, no matter the length of the signed content. It is safe to find out the actual signature length your certificate produces and use it to properly configure the placeholder length.

PAdES compliant signatures

To produce PAdES compliant signatures, the ETSI Signature Dictionary SubFilter value must be ETSI.CAdES.detached instead of the standard Adobe value.

This can be declared using the subFilter option argument.

import { pdflibAddPlaceholder } from '@signpdf/placeholder-pdf-lib';
import { SUBFILTER_ETSI_CADES_DETACHED } from '@signpdf/utils';

pdflibAddPlaceholder({
  pdfDoc: pdfToSign,
  ...,
  subFilter: SUBFILTER_ETSI_CADES_DETACHED,
});

Keywords

FAQs

Package last updated on 18 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc