You can use the commandline to export all layers. First, so see how many or which layers we have, with --query-all
or -S
:
$ inkscape --query-all presentation.svg | grep layer | awk -F, '{print $1}'
layer1
layer2
layer3
With the id (exakt name) of the layer, you can now export it with --export-id=ID
or -i
and -j, --export-id-only
$ inkscape presentation.svg -i layer1 -j -C --export-png=layer1.png
-C, --export-area-page
defines the exported area (full page, as defined in document properties). You can also use --export-ps
, --export-pdf
, --export-eps
and some other.
To automate it, you can generate a command list:
$ for id in `seq 1 15`; do echo "presentation.svg -jC -i layer$id -e layer$id.png"; done
presentation.svg -jC -i layer1 -e layer1.png
presentation.svg -jC -i layer2 -e layer2.png
presentation.svg -jC -i layer3 -e layer3.png
Or to export all layers:
$ for layer in $(inkscape --query-all presentation.svg | grep layer | awk -F, '{print $1}'); do echo "presentation.svg -jC -i $layer -e $layer.png"; done
When you save this in a file (here commands.txt
), you can invoke inkscape like this:
$ inkscape --shell < commands.txt
do execute all listed commands.