pdf-flatten
A nodejs module for flattening a PDF file.
This comes in handy when signatures, text, or images aren't sticking to a PDF file after using a tool to copy/convert a pdf like hummus or PDFTK.
Dependencies
- GraphicsMagick
Note: Windows users, please be sure GraphicsMagick and Ghostscript are installed (see https://stackoverflow.com/questions/18733695/cimg-error-gm-exe-is-not-recognized-as-an-internal-or-external-command/45783910#45783910 for details) - then it works fine on Windows.
Ubuntu
sudo apt-get install graphicsmagick
OSX
brew install graphicsmagick
Installation
$ [sudo] npm install pdf-flatten
Usage
const fs = ;const flattener = ; const inputBuffer = fs; // the flatten() method takes a buffer as an inputflattener
Options
You can increase the conversion pixel density to your liking, the default is 200 if nothing is provided.
flattener
Maintainer
License
MIT