omega
omega

Reputation: 43933

How to use inkscape command line interface?

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

Upvotes: 14

Views: 20723

Answers (4)

Wallace
Wallace

Reputation: 17488

On Windows, in the C:\Program Files\Inkscape\bin folder, you will see both inkscape.exe and inkscape.com. Use inkscape.com.

Here is an example from PowerShell:

> & "C:\Program Files\Inkscape\bin\inkscape.com" --help

Upvotes: 9

Danny Muniz
Danny Muniz

Reputation: 9

@echo off

REM setup Inskcape File Location

cd /d "C:\Program Files\Inkscape"

inkscape path\filename.svg --export-dpi=120 -e exported_image_name.png --without-gui

Upvotes: -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.

Upvotes: 4

mrcl
mrcl

Reputation: 2190

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

Upvotes: 1

Related Questions