From 22d10243d5402b41e24cc39c5c506ef75677fe41 Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Sun, 7 Jul 2013 20:27:27 +0100 Subject: [PATCH] Crop PDFs after generation so that they don't have white borders - document can do that. --- makeGraphics.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/makeGraphics.sh b/makeGraphics.sh index 8ec9030..dbdb550 100755 --- a/makeGraphics.sh +++ b/makeGraphics.sh @@ -27,12 +27,18 @@ find $booke -name "*.abc" | sort | # Make $name.eps so we can build with LaTeX. mv $graphicsdir/${name}001.eps $graphicsdir/${name}.eps # And make the corresponding PDF. - epstopdf --outfile=$graphicsdir/$name.pdf $graphicsdir/${name}.eps + epstopdf --outfile=$graphicsdir/$name-tocrop.pdf $graphicsdir/${name}.eps + # And crop it, so the graphic is as big as possible on the page. + pdfcrop $graphicsdir/$name-tocrop.pdf $graphicsdir/$name.pdf + rm $graphicsdir/$name-tocrop.pdf # and make the first line graphic. $dir/abcfirstline.py $filename > firstline.abc abcm2ps +c -M +Q -E -O $graphicsdir/firstline-$name.eps firstline.abc mv $graphicsdir/firstline-${name}001.eps $graphicsdir/firstline-${name}.eps rm firstline.abc - epstopdf --outfile=$graphicsdir/firstline-$name.pdf $graphicsdir/firstline-${name}.eps + epstopdf --outfile=$graphicsdir/firstline-$name-tocrop.pdf $graphicsdir/firstline-${name}.eps + # And crop it, so the graphic is as big as possible on the page. + pdfcrop $graphicsdir/firstline-$name-tocrop.pdf $graphicsdir/firstline-$name.pdf + rm $graphicsdir/firstline-$name-tocrop.pdf done