0.1.3 • Published 3 years ago

@pantherx.dev/node-pdf-signature v0.1.3

Weekly downloads
15
License
MIT
Repository
-
Last release
3 years ago

node PDF Signature

Small (TS) library to "sign" PDF documents with a QR code.

The goal of this library is to enable novice users to easily verify whether a PDF (on, or off-screen "printed") is authentic, and has been signed, by directing them to a website.

Example

File-based conversion:

import { promises as fs } from 'fs';
import { signPdfBuffer } from '../src';

const source = 'source.pdf'
const destination = 'destination.pdf'
const message = `a1113493-b844-4169-95c5-a626c36e665c`
const qrCodeContent = `https://someurl.com/a1113493-b844-4169-95c5-a626c36e665c`

async function automatic() {
  const pdfBuffer = await fs.readFile(source)
  const modifiedPdf = await signPdfBuffer(pdfBuffer, message, qrCodeContent)
  await fs.writeFile(destination, modifiedPdf.data, 'utf-8') 
}

TODO

  • File based conversion
  • Delete images after file-based conversion
  • Properly handle horizontal and vertical orientation of input
  • Rename input files prior to file-based conversion to mitigate some exploits
  • Position the QR code in varios locations
  • Embed Signature in PDF

Thanks

The hard work is done by:

  • pdf-lib
0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.3

3 years ago

0.0.12

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago