Last active
October 23, 2020 13:30
-
-
Save stefan2904/e7ee97716685281461f3e470bd4ed6f6 to your computer and use it in GitHub Desktop.
draw.io / diagrams.net batch exporter
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/bash | |
# Get desktop-app (which includes CLI) from http://get.diagrams.net | |
NUM_PAGES=4 | |
DRAWIO_FILE="cdn-setup1" | |
#set -o xtrace | |
for ((page=0; page<NUM_PAGES; page++)) | |
do | |
idx="$(($page+1))" | |
PAGENAME=`xpath -e "string(/mxfile/diagram[$idx]/@name)" -q $DRAWIO_FILE.drawio` | |
echo $PAGENAME | |
# OUTNAME="$DRAWIO_FILE-$PAGENAME.pdf" | |
OUTNAME="$DRAWIO_FILE-Slide$page.pdf" | |
drawio --export \ | |
--format pdf \ | |
--crop \ | |
--transparent \ | |
--page-index $page \ | |
--output $OUTNAME \ | |
$DRAWIO_FILE.drawio | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment