inkscape-cli
inkscape-cli is a Node.js binding for Inkscape's command line interface. You need to have Inkscape installed to your computer. Furthermore, inkscape-cli is designed for Windows. Other platforms may not work well.
Github: https://github.com/The3DSquare/inkscape-cli
NPM: https://www.npmjs.com/package/inkscape-cli
Quick start:
Import the library into your code and start coding!
const I = ; const save_as_pdf = I;I;
Documentation
setFolder(path)
Tells inkscape-cli that inkscape.exe
is in the folder specified by path
.
param | type | description |
---|---|---|
path | String |
Path to Inkscape's folder |
I;
- Path must use
\\
instead of/
- It's ok to leave spaces in the path
O
inkscape-cli has an object called O
. O
has all the options one can use when creating a command with generateCommand
. Go to https://inkscape.org/doc/inkscape-man.html for specific details about each command.
Here are some examples:
IO;IOexport_area_drawing;IO;
File paths need to use \\
instead of /
. Feel free to leave spaces in a filepath as well.
Options with no parameter can be left without ()
. Options that do need parameters can put them in via a function call.
generateCommand(args)
Generates a command inkscape-cli can run.
param | type | description |
---|---|---|
args | Array |
An array of I.O. values |
const savePDF = I;const savePNG = I;
runCommand(command)
Runs a command generated by generateCommand
param | type | description |
---|---|---|
command | String |
A command created by generateCommand |
I;
chainCommands(commands)
Runs multiple commands one at a time
param | type | description |
---|---|---|
commands | Array<String> |
Array of commands created by generateCommand |
I;