Forum Bugs

Prince with redirected input and output

renfrow
Running prince with redirected input and output,
prince --baseurl=http://whatever --input=html --log=/tmp/prince.out --output=- - < file.html > file.pdf
works fine.

However, I've wrappered a call to prince so that the input and output are sockets (pseudo codish):
fd = listen(addr, port);
dup2(fd, 0);
dup2(fd, 1);
exec("prince --baseurl=http://whatever --input=html --log=/tmp/prince.out --output=- -);

It 'runs'... I can send it html, and get pdf back, however, it can't find any of the embedded references, no images or styles. And the log file shows lines similar to:
Thu Mar 10 17:17:40 2011: 'http:/whatever/image.png: warning: can't open input file: No such file or directory
Note the single slash in the url, rather than 2 slashes. I tried putting 10 slashes :) in there, and it deleted them all back to a single slash...

Any clue what I'm doing wrong?

I have it working, with input and output files:
system("prince --baseurl=http://whatever --input=html --log=/tmp/prince.out --output=file.pdf file.html);
and am having the wrapper stream the input to the file.html, prior to the system(), and the file.pdf to the output, after the system(), but they (the powers that be) want to stream in and out for more efficiency...

I am evaluating this to see if we want to purchase a server license. (A library version, to link into the wrapper, would be ideal!)

Tom Kimpton.
renfrow
Imagine blushing programmer, at this point. I wasn't actually prepending '--baseurl=' to the baseurl. My mistake, it's all good :).

Oops,
Tom.