0.1.0 • Published 10 years ago
pdf-narcissist v0.1.0
pdf-narcissist
Hide a PDF inside a thumbnail of its own first page
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 numberpdf-narcissist encode in.pdf encoded.pngpdf-narcissist decode encoded.png out.pdfLibrary
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-narcissistFor library use
npm install --save pdf-narcissist0.1.0
10 years ago