Bash scripts to manipulate PDF files.
The easiest way to install pdf-tools is via basher:
$ basher install hagenw/pdf-tools
PDF tools depends on simply-bash.
Install all files of pdf-tools into a directory in your $PATH
. The easiest
way to achieve this is to clone the repository and add it to your $PATH
:
$ git clone https://github.com/hagenw/pdf-tools.git ~/git/pdf-tools
$ echo 'PATH="${PATH}:${HOME}/git/pdf-tools"' >> ~/.bashrc
Replace ~/git/pdf-tools
with your desired directory.
Install simply-bash by cloning it and sourcing simply-bash.sh
, e.g.
$ git clone https://github.com/hagenw/simply-bash.git ~/git/simply-bash
$ source ~/git/simply-bash/simply-bash.sh
Generate a thumbnail of the given PDF file as a compressed PNG file. Example:
$ pdf2png --max-size 400 --page 2 --output page2_400px.png input.pdf
Extract pages from a PDF file. Example:
$ pdfextract --pages "1 3-5" --output output.pdf input.pdf
Merge PDF files. Example:
$ pdfmerge --output output.pdf input1.pdf input2.pdf input3.pdf
Shrink a PDF file. Example:
$ pdfshrink --aggressive input.pdf