Created
March 7, 2017 02:37
-
-
Save JZL/52674ac512c02f7e0c1d0b9d4d7fe424 to your computer and use it in GitHub Desktop.
Krop bash alias
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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