PHPackages                             lovasoa/ophir - 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. lovasoa/ophir

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

lovasoa/ophir
=============

Convert ODT (OpenDocument) files to HTML

0.1(12y ago)241726[7 issues](https://github.com/lovasoa/ophir.php/issues)PHP

Since May 13Pushed 7y ago3 watchersCompare

[ Source](https://github.com/lovasoa/ophir.php)[ Packagist](https://packagist.org/packages/lovasoa/ophir)[ RSS](/packages/lovasoa-ophir/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (4)Used By (0)

Ophir.php
=========

[](#ophirphp)

PHP script that converts ODT to HTML
------------------------------------

[](#php-script-that-converts-odt-to-html)

ophir.php is a lightweight script that parses an **open document** file and outputs a ***simple* HTML** file, with very few tags (contrarily to most other tools that do the same thing).

Features
--------

[](#features)

Currently, the script can convert the following:

- bold (`` tag)
- italic (`` tag)
- underline (`` tag)
- quotations (`` tag)
- images (using data URIs)
- links
- headings (h1, h2, ...)
- lists (ul and li)
- tables (table tr and td)
- annotations
- footnotes.

Ophir.php can also **ignore** or **remove** some tags on demand. This can be useful if you want to extract *only unformatted text* from a document, or if you don't want tables, footnotes or annotations in the resulting HTML, or if the application that generated the ODT file produced unnecessary formatting informations ...

Limitations
-----------

[](#limitations)

Everything that is not mentioned in the feature section is not supported.

How to use this script
----------------------

[](#how-to-use-this-script)

This script requires libzip and XMLReader, that are usually installed by default with php5. If you meet these requirements, just put ophir.php on your server, and use it like that:

```
require("ophir.php");

$OPHIR_CONF["footnote"] = 0; //Do not import footnotes
$OPHIR_CONF["annotation"] = 0; //Do not import annotations

$OPHIR_CONF["list"] = 1; //Import lists, but prints them as simple text (no ul or li tags will be generated)
$OPHIR_CONF["link"] = 1; //Import links, but prints them as simple text (only extract text from the links)

/*Available parameters are:
"header", "quote", "list", "table", "footnote", "link", "image", "note", and "annotation"
*/

echo odt2html("/path/to/file.odt");
```

License
-------

[](#license)

Ophir.php is under LGPLv3. You can use it in both your free and proprietary software projects, but if you change some of the code, you have to share your improvements. Full license informations available at .

Other scripts
-------------

[](#other-scripts)

This script was coded in one afternoon to answer to my personal needs. More professional tools, with more features, that produce uglier HTML files are available:

- [https://github.com/lovasoa/ophir\_odt\_import](https://github.com/lovasoa/ophir_odt_import) A drupal 7 module I created that uses ophir.php to import ODT files to Drupal.
-  (in PHP)
-  (in java)
-  (in Python)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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

Unknown

Total

1

Last Release

4387d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/73afe4e714bad6a4dc26a7d645a84d0166d19fe6a1b6c05deffe755e1e271764?d=identicon)[j6s](/maintainers/j6s)

![](https://www.gravatar.com/avatar/20b7012a66537c63f97b9f5788f166d4c0d0ca6959c305ba19289b81a6ec86a9?d=identicon)[lovasoa](/maintainers/lovasoa)

---

Top Contributors

[![lovasoa](https://avatars.githubusercontent.com/u/552629?v=4)](https://github.com/lovasoa "lovasoa (10 commits)")[![gustavklopp](https://avatars.githubusercontent.com/u/6438275?v=4)](https://github.com/gustavklopp "gustavklopp (1 commits)")[![j6s](https://avatars.githubusercontent.com/u/3374170?v=4)](https://github.com/j6s "j6s (1 commits)")

### Embed Badge

![Health badge](/badges/lovasoa-ophir/health.svg)

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

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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