Create OpenOffice documents with PHP + templates
13 Okt 2005
This class can be used to generate OpenOffice documents by using templates and a template engine to replace the template placeholders by parameter values.
The class extends the template engine class TinyButStrong.
The class allows the creation of OpenOffice documents dynamically, providing the separation between the document formatting logic and content.
In practice, you create a template using OpenOffice but with the TinyButStrong tags. Then you create a PHP script that calls the class to merge the document template with dynamically defined data. The class will generate and output the OpenOffice document.
Features
- It works on Linux, Windows and other platforms
- It works with OpenOffice 1.x documents and the new format used in OpenOffice 2 (OpenDocument 1.0, OASIS standard)
- It does not need an installation of OpenOffice on the server
- It uses the TinyButStrong native syntax and methods. It can merge ‘var’ and ‘blocks’ using the TinyButStrong syntax like (var, block, if, then, frm, …). The merge results respects the layout, justification and styles used in the template.
Limitations
- You need to know the TBS template engine syntax (simple to learn)
- It uses the ‘exec’ command from PHP
- TBS fields merged in OpenOffice are text, so you can’t use OpenOffice format like date, number, link.
- You can’t add/update dynamic image
- You can’t add/update dynamic style
More information can be found here.
29 Jan 2006 at 8:39 am
I do not agree with your statement:
“You need to know the TBS template engine syntax (simple to learn)”
TBS syntax is far mor difficult than the one used by Smarty. It is counter-intuitive.
16 Jun 2006 at 11:11 am
Esli Vy chitaete eto soobshenie znachit vasha gostevaya, forum ili blog popali v spamerskii spisok rassylok. Chtoby udalit’ svoi resurs iz etogo spiska prishlite ego url na email: antyspam@bk.ru Eto v vashih zhe interesah. Vse eshe mozhno popravit’. Nam nuzhny tol’ko zabroshennye resursy. Esli vash eshe razvivaetsya – my ostavim ego v pokoe.