Forum How do I...?

running prince as a daemon on linux

Anonymous
Hi

I have tested the evaluation copy using the command line interface of prince on a linux box (RH8.0) - it works great.

What we really want to do is to run prince as a daemon that can accept xhtml requests and respond with a text stream which is the pdf document (i.e. content-type=application/pdf). From reading the docs and postings I cannot see that this is natively supported. I understand you can embed the application using one of the PHP/java/etc APIs - however we are running a proprietary web server based on the tcl langugage and so cannot use one of these existing APIs - which is why I want to daemonise the process.

Is there any support for this that I am unaware of, or has anyone else wanted to do this also? Otherwise I assume I would have to write a "wrapper" to daemonise the process.

Cheers
Mark
mcgillion
I am now running prince using php on apache - which works fine. The only problem is that we are using php 4.x so I had to convert the php api thus. Additionally, it appears that the api does not provide the same level of error info that the command line version provides. E.g. when I tried to see if prince could handle unicode (utf8) charsets (chinese) I got no reponse from the web browser. I had to debug this using the command line interface and I got the "prince: warning: no glyphs for character U+..." error message.

Is there any plan to extend the php api to provide more feedback?
mikeday
There is a limitation of the PHP and Java APIs at the moment that when operated in streaming mode they cannot return error messages. We will be fixing this limitation in the next release of these APIs.

(Incidentally, Prince will support Chinese characters if it has access to Chinese fonts and if you specify a suitable Chinese font in the font-family for elements containing Chinese text).
Anonymous
I second the interest of a PHP4 API, even if it is not really hard to convert the PHP5 one (remove private/public/throw).

Same thing goes for error management: add a getError method that returns pipes[1]/pipes[2] in case the conversion returns false would be enough in PHP4. Of course, PHP5 exceptions are far better...