I\'m trying to execute Inkscape by passing data via stdin
. Inkscape only supports this via /dev/stdin
. Basically, I\'m trying to do something like this
So, I figured out a work around. This seems like a bit of a hack, but it works just fine.
First, I made this one line shell script:
cat | inkscape -z -f /dev/stdin -A /dev/stdout | cat
Then, I simply spawn that file and write to the stdin like this:
cmd = spawn("shell_script");
cmd.stdin.write(svg);
cmd.stdin.end();
cmd.stdout.pipe(pipe);
I really think this should work without the shell script, but it won't (for me at least). This may be a Node.js bug.