PHPackages                             epse/html2opendocument - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. epse/html2opendocument

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

epse/html2opendocument
======================

Converting simple HTML to Opendocument Text (ODT) or Spreadsheets (ODS)

0.13(7y ago)023MITPHPPHP &gt;=5.5.0

Since Jan 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Epse/html2opendocument)[ Packagist](https://packagist.org/packages/epse/html2opendocument)[ RSS](/packages/epse-html2opendocument/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (1)Versions (14)Used By (0)

This is a simple PHP-library to create create OpenDocument Text- and Spreadsheet-files (ODT / ODS) from HTML-formatted text.

It does not support formulae / calculations in spreadsheets. The focus lies on formatted text.

Example Scripts
---------------

[](#example-scripts)

A demo script for the OpenDocument Text converter using the default template:

```
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php');

$html = 'This is a demo for the converter.
The converter supports the following styles:

    Lists (UL / OL)
    STRONG
    U (underlined)
    S (strike-through)
    EM (emphasis / italic)
    INS (Inserted text)
    DEL (Deleted text)
    Linebreaks with BR

You can also use BLOCKQUOTE, it is even styled!';

$html2 = 'You might be interestedin the fact that this converter
also supportsline numberingfor selected paragraphs
Dummy LineDummy LineDummy Line
Dummy LineDummy Line';

$odt = new \CatoTH\HTML2OpenDocument\Text();
$odt->addHtmlTextBlock('Test Page');
$odt->addHtmlTextBlock($html, false);
$odt->addHtmlTextBlock('Line Numbering');
$odt->addHtmlTextBlock($html2, true);
$odt->finishAndOutputOdt('demo.odt');
```

A demo script for the OpenDocument Spreadsheet converter using the default template:

```
use CatoTH\HTML2OpenDocument\Spreadsheet;
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php');

$ods = new \CatoTH\HTML2OpenDocument\Spreadsheet();

// Setting to landscape mode with custom page margins
$ods->setMargins("20mm", "10mm", "10mm", "20mm");
$ods->setPageOrientation("297mm", "210mm", "landscape");

// Plain text
$ods->setCell(0, 0, Spreadsheet::TYPE_TEXT, 'Plain text with native formatting');
$ods->setCellStyle(0, 0, [], ['fo:font-weight' => 'bold']);

// Print a number as an actual number, just a little bit bigger
$ods->setCell(1, 0, Spreadsheet::TYPE_NUMBER, 23);
$ods->setCellStyle(1, 0, [], [
    'fo:font-size'   => '16pt',
    'fo:font-weight' => 'bold',
]);
$ods->setMinRowHeight(1, 1.5);

// Print a number as text
$ods->setCell(2, 0, Spreadsheet::TYPE_TEXT, '42');

// Draw a border around two of the cells
$ods->drawBorder(1, 0, 2, 0, 1);

// Now we use HTML, and we need a bit more space for that
$html = 'The converter supports the following styles:

    STRONG
    U (underlined)
    S (strike-through)
    EM (emphasis / italic)
    Inserted text
    Deleted text
    Linebreaks with BR
    Lists (UL / OL) cannot be displayed as lists, but will be flattened to paragraphs

You can also use BLOCKQUOTE, it will be styled!';

$ods->setMinRowHeight(3, 10);
$ods->setColumnWidth(1, 20);
$ods->setCell(3, 1, Spreadsheet::TYPE_HTML, $html);

$ods->finishAndOutputOds('demo.ods');
```

License
-------

[](#license)

This library is licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.9% of commits — single point of failure

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

Every ~85 days

Recently: every ~130 days

Total

13

Last Release

2729d ago

PHP version history (2 changes)0.1PHP &gt;=5.4.0

0.7PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2742a91288245136c4821f63d5e8f997a16e590f308602bec3b4bcdfd19ade7c?d=identicon)[epse](/maintainers/epse)

---

Top Contributors

[![CatoTH](https://avatars.githubusercontent.com/u/533440?v=4)](https://github.com/CatoTH "CatoTH (26 commits)")[![Epse](https://avatars.githubusercontent.com/u/10013355?v=4)](https://github.com/Epse "Epse (4 commits)")[![thibaultjunin](https://avatars.githubusercontent.com/u/12583049?v=4)](https://github.com/thibaultjunin "thibaultjunin (1 commits)")

---

Tags

htmlodtOpenDocumentods

### Embed Badge

![Health badge](/badges/epse-html2opendocument/health.svg)

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

###  Alternatives

[phpoffice/phpword

PHPWord - A pure PHP library for reading and writing word processing documents (OOXML, ODF, RTF, HTML, PDF)

7.5k34.7M186](/packages/phpoffice-phpword)[catoth/html2opendocument

Converting simple HTML to Opendocument Text (ODT) or Spreadsheets (ODS)

1117.5k](/packages/catoth-html2opendocument)[nilgems/laravel-textract

A Laravel package to extract text from files like DOC, XL, Image, Pdf and more. I've developed this package by inspiring "npm textract".

195.2k](/packages/nilgems-laravel-textract)

PHPackages © 2026

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