Inkscape.org
Using Inkscape with Other Programs Writing queries to file
  1. #1
    Daniel56436335 Daniel56436335 @Daniel56436335
    *

    Hi, I want to use inkscape in a python program to convert SVGs to PNG and create bounding boxes. The fastest way is to use inkscape in shell mode:

    ```

    $ inkscape --shell

    $ file-load:"input.svg"

    $ export-filename:"output.png"

    $ export-do

    ```

    This works pretty fast. I can also print all bounding boxes with $ query-all. The problem is, that printing all this information over stdout is terribly slow compared to the conversion. Is there a way to write this directly into a file to avoid slow bufering, like:
    `$ query-all > bboxes.csv`

     

  2. #2
    inklinea inklinea @inklinea⛰️

    inkscape --shell >&1 | tee -a shell.txt

  3. #3
    Daniel56436335 Daniel56436335 @Daniel56436335

    Can you explain this? I am on windows, is there a working alternative?

  4. #4
    inklinea inklinea @inklinea⛰️

    I'm not sure about Windows.

    You can install and run Inkscape on Ubuntu in the windows Linux subsystem.

    https://ubuntu.com/desktop/wsl

    Provided that you do not use commands that require the GUI ( which shell mode rejects anyway )