Last active
February 11, 2021 10:15
-
-
Save dvnoble/54d095fa74a4f9aa4f1feab8a7cda5e6 to your computer and use it in GitHub Desktop.
Simple bash script to batch convert graphs descriptions (dot format) into a pdf. It requires graphviz.
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 | |
for GFILE in *.dot; | |
do | |
GNAME="${GFILE%.*}"; | |
GTYPE=$(head -n 1 $GFILE); | |
case "$GTYPE" in | |
*digraph*) dot -Teps $GFILE -o "$GNAME.eps";; | |
*graph*) neato -Teps $GFILE -o "$GNAME.eps";; | |
esac | |
ps2pdf -dCompatibilityLevel=1.4 -dEmbedAllFonts=true -dSubsetFonts=true \ | |
-dEPSCrop "$GNAME.eps" "$GNAME.pdf"; | |
done | |
#rm *.eps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment