Skip to content

Instantly share code, notes, and snippets.

@eug
Created January 13, 2020 15:51
Show Gist options
  • Save eug/86f3e5fca1144ae3d2dee817454e61ae to your computer and use it in GitHub Desktop.
Save eug/86f3e5fca1144ae3d2dee817454e61ae to your computer and use it in GitHub Desktop.
PDF file manipulation via CLI
sudo apt-get install pdftk poppler-utils texlive-extra-utils
# Merge
pdfunite in-1.pdf in-2.pdf in-n.pdf out-merged.pdf
# Rotate
# 1-endnorth
# 1-endsouth
# 1-endeast
# 1-endwest
# 1-endleft
# 1-endright
# 1-enddown
pdftk in-1.pdf cat 1-endsouth output out-rotated.pdf
# Crop
# margin: left, top, right, bottom in point units
pdfcrop --margins '0 0 -140 -450' in-1.pdf out-cropped.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment