New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

inkscape-cli

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inkscape-cli

Bindings for Inkscape's command line interface

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

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 = require('inkscape-cli');

const save_as_pdf = I.generate_command([
    I.O.file('.\\File.svg'),
    I.O.export_area_page,
    I.O.export_pdf('.\\File.pdf')
]);
I.run_command(save_as_pdf);

Documentation

setFolder(path)

Tells inkscape-cli that inkscape.exe is in the folder specified by path.

paramtypedescription
pathStringPath to Inkscape's folder
I.inkscape_folder("C:\\Program Files\\Inkscape\\");
  • 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:

I.O.file('.\\File.svg');
I.O.export_area_drawing;
I.O.export_png('.\\File Image.png');

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.

paramtypedescription
argsArrayAn array of I.O. values
const savePDF = I.generateCommand([
    I.O.file('.\\File.svg'),
    I.O.export_area_page,
    I.O.export_pdf('.\\File.pdf')
]);
const savePNG = I.generateCommand([
    I.O.file('.\\File.svg'),
    I.O.export_area_drawing,
    I.O.export_width(2024),
    I.O.export_height(1024),
    I.O.export_png('.\\File.png')
]);

runCommand(command)

Runs a command generated by generateCommand

paramtypedescription
commandStringA command created by generateCommand
I.runCommand(savePDF);

chainCommands(commands)

Runs multiple commands one at a time

paramtypedescription
commandsArray<String>Array of commands created by generateCommand
I.chainCommands([savePDF, savePNG]);

FAQs

Package last updated on 17 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts