1.0.2 • Published 9 years ago

svgtopng v1.0.2

Weekly downloads
4
License
ISC
Repository
github
Last release
9 years ago

svgtopng

Converts SVGs to PNGs

Inspired by https://github.com/filamentgroup/svg-to-png

usage

npm install svgtopng
var svgToPng = require('svg-to-png');

svgToPng('path to an .svg', 'path for the output .png'[, options], callback);

example

var svgToPng = require('../'),
    path = require('path');

svgToPng(
    path.join(__dirname, './node.svg'),
    path.join(__dirname, './results/node500.png'),
    {
        width: 500,
        height: 500
    },
    function(error){
        // if no error, the .png will be on disk
    }
);

options

options are optional.

height

Resize the image to specified height

width

Resize the image to specified width

defaultWidth

If the svg does not specify a width, this will be used

defaultHeight

If the svg does not specify a height, this will be used

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago