Created
April 28, 2015 07:59
-
-
Save tenomoto/82dd5ecf53b85f9a8b1c to your computer and use it in GitHub Desktop.
Create EPS from PDF with white margin cropped using pdfcrop and pdftoeps
This file contains hidden or 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
#!/bin/sh | |
if [ $# -lt 1 ]; then | |
echo "Usage :: $0 input.pdf [p1 p2 ...]" | |
exit | |
fi | |
in=${1} | |
shift | |
pdfcrop ${in} | |
crop=`basename -s .pdf ${in}`-crop | |
if [ $# -eq 0 ]; then | |
pdftops -f 1 -l 1 -eps ${crop}.pdf && mv ${crop}.eps ${in%.pdf}.eps | |
else | |
while [ $# -gt 0 ]; do | |
p=$1 | |
pdftops -f ${p} -l ${p} -eps ${crop}.pdf && mv ${crop}.eps ${in%.pdf}_${p}.eps | |
shift | |
done | |
fi | |
rm ${crop}.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment