+}
+
+close($svg_template);
+close($svg);
+
+open(my $inkscape, '|-', 'inkscape --shell --without-gui');
+
+sub inkscape_export {
+ my $part = shift;
+
+ my $shell = "$out.svg --export-area-page --export-id $part";
+
+ print $inkscape "$shell --export-pdf $out.$part.pdf\n";
+ print $inkscape "$shell --export-png $out.$part.png --export-dpi 150\n";
+}
+
+inkscape_export 'print-front';
+inkscape_export 'print-back';
+
+# export visible
+print $inkscape "$out.svg --export-png $out.png --export-dpi 300\n";
+
+close($inkscape);