PHPackages                             lebedevsergey/odt2xhtml - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. lebedevsergey/odt2xhtml

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

lebedevsergey/odt2xhtml
=======================

A small library for converting documents in Open Document Format to HTML. Based on the code from https://github.com/hucste/Odt2Xhtml

v1.0(5y ago)0951↓33.3%MITPHPPHP &gt;=5.6

Since Feb 12Pushed 5y ago1 watchersCompare

[ Source](https://github.com/lebedevsergey/odt2xhtml)[ Packagist](https://packagist.org/packages/lebedevsergey/odt2xhtml)[ RSS](/packages/lebedevsergey-odt2xhtml/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

ODT2XHTML
=========

[](#odt2xhtml)

### What is it?

[](#what-is-it)

- ODT2XHTML is a small library for converting documents in Open Document Format to HTML.
- Supports most ODF text formatting features including embedded images, lists, tables, subscripts, supescripts, etc.
- *Based on heavily refactored code from [Odt2Xhtml library](https://github.com/hucste/Odt2Xhtml) by Stéphane HUC. Example ODF files are taken from original library*

### How to use it?

[](#how-to-use-it)

- Add ODT2XHTML to your project `composer require lebedevsergey/odt2xhtml`
- create ODT2XHTML object: `$converter = new ODT2XHTML()`
- call `convert` method: `$converter->convert($ODTFilePath, $ODTHTMLPath, true);`

where:

- `$ODTFilePath` - path to Open Office document to convert
- `$ODTHTMLPath` - path to the resulted HTML folder, HTML file name will be the same as the Open Office document file name but with `.html` extension
- the third value is the boolean flag whether resulted CSS styles will be embedded into generated HTML file or will be in a separate CSS file

See also included example code in `example.php`.

### What else?

[](#what-else)

- supports files in:
    - Open Document Format with extensions: `.odb, .odc, .odf, .odg, .odi, .odp, .ods, .odt, .odm, .otg, .oth, .otp, .ots, .ott`
    - StarOffice format with extensions: `.stc, .std, .sti, .stw, .sxc, .sxd, .sxg, .sxi, .sxm, .sxw`
- PHP 5.6 or higher is required

### Authors?

[](#authors)

- base code © 2007-2011 Stéphane HUC
- © 2020 Sergey Lebedev, licensed under the Apache License, Version 2.0
- Feel free to contact me at:
    -
    -
    -

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1921d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ddd293ff132422c8ef6cf142c6508e98e024e34c331e3af210fcc17d3bb679fc?d=identicon)[lebedevsergey](/maintainers/lebedevsergey)

---

Tags

converterodfphpphp7htmlodf

### Embed Badge

![Health badge](/badges/lebedevsergey-odt2xhtml/health.svg)

```
[![Health](https://phpackages.com/badges/lebedevsergey-odt2xhtml/health.svg)](https://phpackages.com/packages/lebedevsergey-odt2xhtml)
```

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[league/html-to-markdown

An HTML-to-markdown conversion helper for PHP

1.9k28.6M199](/packages/league-html-to-markdown)[paquettg/php-html-parser

An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.

2.4k7.9M123](/packages/paquettg-php-html-parser)[sunra/php-simple-html-dom-parser

Composer adaptation of: A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way! Require PHP 5+. Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.

1.3k9.4M61](/packages/sunra-php-simple-html-dom-parser)[imangazaliev/didom

Simple and fast HTML parser

2.2k2.3M64](/packages/imangazaliev-didom)[querypath/querypath

HTML/XML querying and processing (like jQuery)

8197.0M27](/packages/querypath-querypath)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
