-1

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.

1
  • why the downvote?
    – WP Shala
    Jan 7 at 17:23

1 Answer 1

0

Without looping through all your PDF files explicitly using a for loop, you can use this command line:

inkscape --export-type=svg *.pdf

This will convert all the PDF documents in the current directory to SVG format.

Note:

In Windows, if the asterisk * does not work, enter the filenames manually, e.g.:

inkscape --export-type=svg doc1.pdf doc2.pdf doc3.pdf
1
  • My bash script is already doing this. "save each path (individual shapes within the pdf) from that file as a separate svg in a folder"
    – WP Shala
    Jan 6 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.