Hide a PDF inside a thumbnail of its own first page.
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.
$ 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
var narcissist = require('pdf-narcissist')
narcissist.encode('in.pdf', 'encoded.png', function(err) {
// done
})
narcissist.decode('encoded.png', 'out.pdf', function(err) {
// done
})
For CLI use
npm install --global pdf-narcissist
For library use
npm install --save pdf-narcissist