Skip to content

Instantly share code, notes, and snippets.

@NigelThorne
Created October 27, 2015 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NigelThorne/e81a91fa2b30a721e201 to your computer and use it in GitHub Desktop.
Save NigelThorne/e81a91fa2b30a721e201 to your computer and use it in GitHub Desktop.
Shell script to take two pdfs (one all odd pages, one all even) and merge them then rescale the images to reduce the file size for emailing.
# Example script to collate and reduce size of scanned pdf. Idea taken from Stackoverflow answers
# interleave two pdfs as one
pdftk A=Emma\ front\ half.pdf B=Emma\ back\ half.pdf shuffle A B output Emma.pdf
# convert to postscript
pdf2ps Emma.pdf Emma.ps
# convert back with defined resolution 150
ps2pdf -dPDFSETTINGS=/screen -dDownsampleColorImages=false -dColorImageResolution=150 -dColorImageDownsampleType=/Bicubic Emma.ps Emma_ps150b.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment