Forum How do I...?

running prince as a remote server

mcgillion
Hi

Is it possible to run the Prince binary as a remote server? E.g. if my php server is on machine X and the Prince binary is on machine Y?

I guess its possible to expose Prince using another script (php for example) on machine Y. But the question is then can you simply pass the xhtml and css to the binary via http post?

Thanks
Mark
mikeday
Prince is not a server itself, so you would need to access it via another script on machine Y. That script could then accept posts and pass the content on to Prince, then capture the resulting PDF and send it back to the caller. This all sounds rather complicated though; what is the use case exactly?
mcgillion
Hi Mike

The use case is as follows:

background

We currently have an in-house pdf generator which has some nice features (html->pdf, css1, svg, embeds only used chars/glyphs, etc) but some crucial ones which are not as nice as Prince (xml,css2+3). However Pdf generation is not our core business and so we are seriously considering scrapping it and going with an external provider (Prince) because our customers are asking for new features which would require a lot of changes and are therefore not economical for us.

usecase

Our infra is as follows: we run several webservers (proprietary+apache) hosting CGI-based applications. Users are widely distributed over the internet (and corporate intranets). There are various backend datastores including Oracle, MySQL, proprietary db servers, plus our inhouse pdf server. An example use is the creation of mutual fund fact sheets. Users can request either html factsheets or pdf factsheets, or both. These factsheets can either be requested on the fly by an individual user or in bulk by batch processes (so we need scalability).

Our current pdf server runs only as a linux service on a centralised remote machine. The server accepts html requests over a proprietary protocol (not http) over tcp. The frontend webservers (of which there are hundreds) can send an html request to this machine and receive a pdf response.

We are seriously considering replacing our pdf server with Prince for the additional features mentioned above. But we need to know if it can be run in this context. I am sure this is workable, we simply need a webserver running locally with Prince to forward the xml requests and return the pdf response - but I just wanted some kind of confirmation.

Regards
Mark
mikeday
Sounds rather exciting. :)

Prince should have no trouble working in that kind of environment, it just needs a bit of scripting/PHP glue on your side to connect everything up.