From 8f7a8b3b161bdfc5fbd87c41a8217d1a5fea7670 Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Tue, 15 Apr 2025 09:56:02 +0200 Subject: [PATCH] Add inkscape directory --- figs/inkscape/convert_svg.sh | 18 ++++++++++++++++++ figs/{ => inkscape}/nass_concept_schematic.svg | 0 2 files changed, 18 insertions(+) create mode 100755 figs/inkscape/convert_svg.sh rename figs/{ => inkscape}/nass_concept_schematic.svg (100%) diff --git a/figs/inkscape/convert_svg.sh b/figs/inkscape/convert_svg.sh new file mode 100755 index 0000000..c9c1755 --- /dev/null +++ b/figs/inkscape/convert_svg.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Directory containing SVG files +INPUT_DIR="." + +# Loop through all SVG files in the directory +for svg_file in "$INPUT_DIR"/*.svg; do + # Check if there are SVG files in the directory + if [ -f "$svg_file" ]; then + # Output PDF file name + pdf_file="../${svg_file%.svg}.pdf" + png_file="../${svg_file%.svg}" + + # Convert SVG to PDF using Inkscape + inkscape "$svg_file" --export-filename="$pdf_file" && \ + pdftocairo -png -singlefile -cropbox "$pdf_file" "$png_file" + fi +done diff --git a/figs/nass_concept_schematic.svg b/figs/inkscape/nass_concept_schematic.svg similarity index 100% rename from figs/nass_concept_schematic.svg rename to figs/inkscape/nass_concept_schematic.svg