I was able to use a shellscript to open all pdfs from a folder and save to svg like:
# Convert the PDF to SVG (basic conversion)
"$INKSCAPE_PATH" --file="$pdf_file" --export-plain-svg="$SVG_DIR/$filename_no_ext/$filename_no_ext.svg"
But what I need to do is export individual paths as separate svg files, in a folder with the filename (the opening, saving to named folder part is working through the shell script).
Is there a way to script selecting the 'batch export' option, with 'svg' setting?
Right now I can: Open multiple pdf files from a folder, save each one as svg in a folder created and named the filename
What I want to do: Open multiple pdf files from a folder, save each path from that file as a separate svg in a folder created and named the filename
I can achieve this manually using the batch export dialog, but I want to iterate through many files quickly.
I had a look at the Inkscape scripting documentation but couldn't find anything that referred to scripting at this level.
The files are already pdf. This is easy enough to batch process.
What would an action string look like to: open pdf in inkscape select all ungroup select batch export as svg paths create folder with file name export multiple svg files from the pdf into that newly created folder
I was able to use a shellscript to open all pdfs from a folder and save to svg like:
But what I need to do is export individual paths as separate svg files, in a folder with the filename (the opening, saving to named folder part is working through the shell script).
Is there a way to script selecting the 'batch export' option, with 'svg' setting?
Right now I can: Open multiple pdf files from a folder, save each one as svg in a folder created and named the filename
What I want to do: Open multiple pdf files from a folder, save each path from that file as a separate svg in a folder created and named the filename
I can achieve this manually using the batch export dialog, but I want to iterate through many files quickly.
I had a look at the Inkscape scripting documentation but couldn't find anything that referred to scripting at this level.
I think it would have to be done in two steps.
Convert all svg ---> PDF.
Then process those svg files.
I would create a huge text file with an action string on each line, one for every operation.
Then feed that into inkscape shell mode. Shell mode is a special mode which can process actions without having to reload Inkscape each time.
The files are already pdf. This is easy enough to batch process.
What would an action string look like to:
open pdf in inkscape
select all
ungroup
select batch export as svg paths
create folder with file name
export multiple svg files from the pdf into that newly created folder
I meant pdf ---> svg
Which OS / scripting language do you want to use.
bash / powershell / python ?
Bash or python.
If I know the parameters available and what Inkscape can do, I can get help with syntax from a robot friend!