Inkscape.org
Beyond the Basics Export on command line with a different document relative/base directory
  1. #1
    Edaqa Mortoray Edaqa Mortoray @mortoray

    As part of my build process I modify SVG files, outputting temporary copies. I then use the --export-* command line options to export parts of the image to a PNG file.

    Since the file is in a new location relative image links will not be resolved correctly.

    Is there a way, on the command line, to override where to resolve relative paths?   At the moment it appears to also be relative to the SVG file being exported.

     

  2. #2
    inklinea inklinea @inklinea⛰️
    *

    As far as I am aware, it's not possible. 

    If you are using Linux, it's very easy to script in bash using $1, $2, $3  input arguments it would only require inkscape command lines in an bash .sh file 

    So: 

    inkscape_batch.sh input_folder temp_folder output_folder

    The bash script would interpret

    $1 = input_folder , $2 = temp folder , $3 = output folder

    and --export-filename:$3/my_filename.png

    etc is all you need in the batch file to pick up on them.

    There's an example I wrote for looping through files in a folder https://inkscape.org/forums/beyond/automate-shape-shifting/#c26133

     

     

  3. #3
    Edaqa Mortoray Edaqa Mortoray @mortoray

    I'm not sure how I'd get $2, the temp folder, to work. That's the heart of my question. I can't generate the SVG to a temp folder, since the paths are relative to the input_folder.

    I'm generating the temp file inside the input_folder now, but this annoys the build system which sees a file appear and tries to do something with it.

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Export on command line with a different document relative/base directory