Skip to content

Instantly share code, notes, and snippets.

@JZL
Created March 7, 2017 02:37
Show Gist options
  • Save JZL/52674ac512c02f7e0c1d0b9d4d7fe424 to your computer and use it in GitHub Desktop.
Save JZL/52674ac512c02f7e0c1d0b9d4d7fe424 to your computer and use it in GitHub Desktop.
Krop bash alias
function kkrop(){
# convert -gravity SouthEast -flatten -append -trim +repage -transparent white "$1" combined.pdf
convert -gravity SouthEast -flatten -append +repage -transparent white "$1" combined.pdf
pdftk combined.pdf "$1" cat output "$1.combo"
cp /home/jonah/Dropbox/bin/blank.pdf "$1.cropped.pdf"
evince "$1.cropped.pdf" &
krop "$1.combo" --whichpages "2-" -o "$1.cropped.pdf"
rm combined.pdf "$1.combo"
}
@JZL
Copy link
Author

JZL commented Mar 7, 2017

This is a bash_alias which uses image magick and pdftk to have the first page of the krop'ed pdf be an overlay. It only works with white background pages and, if the PDF has differently sized pages, will give a first page which is as large as overlay of all the largest pages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment