Sunday, April 23, 2006

Multi Format Document Generation from PHP with Open Office

My boss suggested that I take a look at the open office wiki developer documentation competition, and perhaps submit how we use OOo as an article.

On the face of it, I initially thought that what we do really falls out of the scope of the competition; but it would be interesting.

We have:
* A bunch of web servers.
* An open office machine or two.
* Load balancers galore.

When someone wants to download a PDF from our site, we open an Open Office document template, modify the XML and replace set fields, add or remove DOM nodes; then push the XML document off to the open office machine, receiving in turn a complete PDF (or word document, or anything else OOo supports).
This means that we can generate almost anything we want, have the full backing of Open Office's underlying code to handle layout; and scale very easily: the web server doesn't do any thinking, that's strictly the job of our document server.

Over the next few posts I'll add pieces of our code and a full writeup.

No comments: