Create OpenOffice documents with PHP + templates

13 Oct 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.


  • 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.


  • 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.

Eén reactie to “Create OpenOffice documents with PHP + templates”

  1. Dany Liscia Says:

    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.

  2. AntySPAM Says:

    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: Eto v vashih zhe interesah. Vse eshe mozhno popravit’. Nam nuzhny tol’ko zabroshennye resursy. Esli vash eshe razvivaetsya – my ostavim ego v pokoe.

Geef een reactie

Gelieve met een van deze methodes in te loggen om je reactie te plaatsen: logo

Je reageert onder je account. Log uit / Bijwerken )


Je reageert onder je Twitter account. Log uit / Bijwerken )

Facebook foto

Je reageert onder je Facebook account. Log uit / Bijwerken )

Google+ photo

Je reageert onder je Google+ account. Log uit / Bijwerken )

Verbinden met %s


Ontvang elk nieuw bericht direct in je inbox.

%d bloggers op de volgende wijze: