How to use inkscape command line interface?

13,551

Solution 1

As of now, there doesn't seem to be a way to do perfect silent processing in Windows. However, any command using inkscape in Windows triggers an empty window while processing in background.

If you don't want it to open separate inkscape windows everytime, try entering the inkscape interactive shell (using inkscape --shell).

PS: I don't think we can do anything more in interactive shell, more than what we can do using cmd. Hopefully someone solves the aforementioned problem in Windows and adds more functionality inside shell.

Solution 2

Have you tried to open the file C:\Users\me\Desktop\Pic\raster.png and see how it looks like? Supposedly by using --export-png in the command line, inkscape will not open the interface but simply process what you requested silently.

In this case you should have the cropped image should be saved in C:\Users\me\Desktop\Pic\raster.png.

I use Linux and tried your example to test and I get the same behaviour you described plus the response in the command line

Background RRGGBBAA: ffffff00
Area 0:0:100:100 exported to 100 x 100 pixels (90 dpi)
Bitmap saved as: raster.png

Hope it helps

Share:
13,551
omega
Author by

omega

Updated on July 26, 2022

Comments

  • omega
    omega almost 2 years

    I'm trying to use the inkscape command line interface. I have windows 7.

    First I open up command line, and I run these:

    cd "C:\Program Files\Inkscape-0.48"
    inkscape "C:\Users\me\Desktop\Pic\Class_UML.png" --export-png="C:\Users\me\Desktop\Pic\raster.png" --export-area=0:0:100:100
    

    Then the inkscape popup opens, and I click embed, and then click ok, and then nothing happens, and the file doesn't show up.

    Does anyone know what I am doing wrong?

    Thanks