tbsOOo project PHP class extends the template engine TinyButStrong.
This class allows to create OpenOffice documents dynamically by separating display formatting from logic and data.
In practice, you create a template using OpenOffice with the TinyButStrong tags.
Then you create a PHP script that merges the template with a data source to get a new OpenOffice document.
Here are some key features of "tbsOOo":
· This class works on Linux, Windows and more…
· This class works with OpenOffice 1.x documents and the new format used in OpenOffice 2 (OpenDocument 1.0, OASIS standard).
· No need to install OpenOffice on your server.
· This class uses the TinyButStrong native syntax and methods. You could merge 'var' and 'blocks' using the TBS syntax like (var, block, if, then, frm, ...). The merging operation respect the layout, justification and styles used in the template.
Limitations:
· This class can't add or change pictures dynamically in OpenOffice documents. The pictures have to be previously added during the template design.
· This class can't add or change styles dynamically in OpenOffice documents. The style have to be previously defined during the template design.
· This class can't use native XML format like 'date', 'url', 'number' in table or spreadsheet. All the merged data are in text format. Instead you can use the 'frm' parameter in TinyButStrong tags for formatting.
Requirements:
server side
· PHP 4 or greater >= 4.0.6
· TinyButStrong PHP class >= 2.02.4
· Zip and Unzip
client side
· OpenOffice 1.1.5
· OpenOffice 2.01 (last version know)
Installation:
Zip and Unzip
The Zip and Unzip binaries are required on server to extract/update XML files of OpenOffice documents with the class.
The default values in class for the binaries path are set to 'zip' and 'unzip'.
By the way, the server environment var 'path' could be set where the binary are installed to have the same setting for Linux and DOS environment and leave the default value.
On Linux, the typical path where ZIP and UNZIP are installed are '/usr/bin/zip' and '/usr/bin/unzip'.
The process directory
The process directory is required to generate new OpenOffice documents. All the operations (extract, merge, ...) are made in this directory with a unique name.
This directory had to be writable for the PHP script (usually the Apache user).
The default value in class is set to 'tmp/' relative to the PHP scripts.
Otherwise you can use the 'tmp' system directory by example :
on Linux, set to '/tmp'.
on DOS set to 'c:/windows/temp' or 'c:\windows\temp'.
OpenOffice
OpenOffice is required on client side to create templates and to visualize result after processing.
To know more on the OpenOffice file format, go to the tips section.
What's New in This Release:
· Correct a problem of EURO caracter
· Correct a problem of zip parameters
· New AddFileToDoc method : Add a file like an image to the current document
Product's homepage