Simple PHP library to manipulate an ODF document.

1.0.5 2018-03-22 08:53 UTC

This package is auto-updated.

Last update: 2024-04-29 03:29:43 UTC


PHP Library to create and edit OpenDocument formats like .odt, .ods, .odp etc. It provides Shortcuts to manipulate the files in an easy way. It is a fork of hanspolo/odfphp to supports newer PHP versions.

Basic usage

This section gives a short introduction in the manipulation of documents.

The first example shows how to create a new document. $type can be text, spreadsheet or an other document type.

   $document = new ODF();

To save the document, you can use the following code. $path is used as the path where the document will be saved.


If you want to extend an existing document, you can load it with this code.

  $document = new ODF();

After initializing your document, you can call:

  $content = Text::getContentBody($document);

or, if you are editing an spreadsheet:

  $content = Spreadsheet::getContentBody($document);

Now you can add elements to your document. ODFphp provides some shortcuts to do this.


Add the content of the src/ directory into your project. To use ODFphp you have to include at least the odf.php file.


ODFphp is licensed under GPL v.3