Last active
September 10, 2018 15:51
-
-
Save dvnoble/079d5d93a946af6aeafc8518adde492d to your computer and use it in GitHub Desktop.
Simple bash script to batch convert svg files into pdfs. It doesn't mess with your fonts and requires rsvg-convert.
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
#!/bin/bash | |
# rsvg-convert is inside librsvg2-bin in ubuntu | |
for SVGFILE in *.svg; | |
do | |
SVGNAME="${SVGFILE%.*}"; | |
rsvg-convert -f eps -o "$SVGNAME.eps" "$SVGFILE" | |
ps2epsi "$SVGNAME.eps" | |
ps2pdf -dCompatibilityLevel=1.4 -dEmbedAllFonts=true -dSubsetFonts=true -dEPSCrop "$SVGNAME.epsi" "$SVGNAME.pdf"; | |
done | |
wait | |
rm *.epsi | |
rm *.eps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment