Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 948
omega Avatar asked Feb 03 '14 03:02

omega


People also ask

What is the command to save a file in Inkscape?

Save (Ctrl+S): Save your drawing to a file. Save As... (Shift+Ctrl+S): Save your drawing to a file with a new name. The Save As dialog includes a folder for Inkscape templates under the name templates.


2 Answers

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.

like image 104
Saravanabalagi Ramachandran Avatar answered Oct 23 '22 22:10

Saravanabalagi Ramachandran


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

like image 32
mrcl Avatar answered Oct 23 '22 23:10

mrcl