All Projects → blahah → pdf-narcissist

blahah / pdf-narcissist

Licence: other
Hide a PDF inside a thumbnail of its own first page

Programming Languages

javascript
184084 projects - #8 most used programming language

pdf-narcissist

Hide a PDF inside a thumbnail of its own first page.

js-standard-style

How it works

pdf-narcissist creates a high definition image of the first page of a PDF using pdf-to-png. Then it compressess the original PDF with bzip2 (using compressjs), and stores the base64 representation of the compressed PDF in the least significant bits of the image using lsb.

Usage

Command-line

$ pdf-narcissist --help

Usage: pdf-narcissist [options] [command]


Commands:

  encode <pdf> <png>  encode a PDF into a PNG thumbnail of itself
  decode <png> <pdf>  extract a PDF from a PNG

Options:

  -h, --help     output usage information
  -V, --version  output the version number

pdf-narcissist encode in.pdf encoded.png
pdf-narcissist decode encoded.png out.pdf

Library

var narcissist = require('pdf-narcissist')

narcissist.encode('in.pdf', 'encoded.png', function(err) {
  // done
})

narcissist.decode('encoded.png', 'out.pdf', function(err) {
  // done
})

Installation

For CLI use

npm install --global pdf-narcissist

For library use

npm install --save pdf-narcissist
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].