pdf-narcissist
v0.1.0
Published
Hide a PDF inside a thumbnail of its own first page
Downloads
1
Readme
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 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