LoginSignup
3
3

More than 5 years have passed since last update.

nodejsでsvgをpngに変換する

Posted at

svgexportというモジュールを使います.

npm install -g svgexport
でインストールできます.

svg_to_png.js
var svgexport = require('svgexport');

var input = [{
  "input": ["./input.svg"],
  "output": [["./output.png",]]
}]

svgexport.render(input, function (result) {
  console.log("done", result);
});

$node svg_to_png.js
で,同じ階層にあるinput.svgファイルをoutput.pngに変換できます.

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3