On Tue, Jul 10, 2012 at 3:58 PM, wavded <wav...@gmail.com> wrote:
> The following code worked fine in 0.6.19, but fails in 0.8.x:
>
> https://github.com/applieddataconsultants/pdfsnag/blob/master/pdfsnag.js#L108-110
>
> I know spawn changed a bit in how it handles stdio in 0.8.x.  The issue is
> that wkhtmltopdf is either failing because of write permissions issue (its
> trying to write out to stdout) or a LD_LIBRARY_PATH issue now where it
> didn't before and I can't figure out how to setup spawn to behave like it
> did in 0.6.19.
>
> Any ideas?  I can get more information if you need.

What do you see when you trace it with `strace -f`?

One change that seems to trip up some applications is that the stdio
file descriptors of the child process are now (anonymous) UNIX domain
sockets again. An easy workaround is to change your call to spawn()
from:

  spawn('wkhtmltopdf');

To:

  spawn('/bin/sh', ['-c', 'cat | wkhtmltopdf | cat']);

That ensures that wkhtmltopdf sees regular pipes as stdin and stdout.

(Be careful when appending parameters, though. Sanitize your input.)

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to