piqnt / svgexport

SVG to PNG/JPEG command-line tool and Node.js module
927 stars 85 forks source link

Windows support #7

Closed SamyPesse closed 9 years ago

SamyPesse commented 9 years ago

On windows, I'm getting an ENOENT error when trying to load phamtomjs. I think this is because on Windows, we need to run phantomjs.cmd instead.

shakiba commented 9 years ago

I just published an update, I have replaced hard-coded phantomjs bin path with require('phantomjs').path, it may fix this issue, please try it. I don't have a Windows installation ready to use, but if it doesn't work then I will prepare one, probably in one or two days.

SamyPesse commented 9 years ago

I'm going to test it. It will be nice to add some basic unittests with Travis (for Linux and OS X) and Appveyor (for Windows, free for open source).

SamyPesse commented 9 years ago

This is not working, but not the same error,

This time, svgexport doesn't crash and return an exit code 0 but stdout is:

SyntaxError: Unable to parse JSON string

I'm debugging this issue and will keep you updated :)

shakiba commented 9 years ago

Thanks, I'm trying Travis.

SamyPesse commented 9 years ago

The issue was comign from GitBook, it's now working fine except one svg that raise an error with phamtomjs (only on windows):

TypeError: 'undefined' is not a function (evaluating 'el.getBBox()')

TypeError: 'null' is not an object (evaluating 'input.height')
shakiba commented 9 years ago

I added svgexport to Travis and Appveyor, thanks for your suggestion! There are some issues with running child process on Appveyor.

For your latest issue I published another update, it may fix it. Otherwise see here, in short your svg should start with<?xml version="1.0" encoding="UTF-8"?>.