PDF MANIPULATION
Here are some simple CLI methods for manipulating PDF documents.
MERGING
pdfunite input1.pdf input2.pdf input3.pdf output.pdf
RECOMPRESSING
There are 3 good ways to recompress
-
Ghostscript (my personal choice, hence why its #1)
Here is a list of the PDFSETTINGS/ parameter options. I prefer ebook for text only documents.
- screen -- lowest quality, smallest size
- ebook -- better quality, average size
- prepress -- similar to Adobe Acrobat Distiller "Prepress Optimized" setting
- printer -- similar to Adobe Acrobat Distiller "Print Optimized" setting
-
default -- a very generic setting. Try first and see how the quality and size are.
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
-
ps2pdf
ps2pdf input.pdf output.pdf
-
convert
convert -density 200x200 -quality 60 -compress jpeg input.pdf output.pdf