https://github.com/lebedevsergey/odt2xhtml
PHP library for converting Open Document Format documents to HTML
https://github.com/lebedevsergey/odt2xhtml
converter odf php php7
Last synced: 5 months ago
JSON representation
PHP library for converting Open Document Format documents to HTML
- Host: GitHub
- URL: https://github.com/lebedevsergey/odt2xhtml
- Owner: lebedevsergey
- License: apache-2.0
- Created: 2021-02-12T08:06:30.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-12T10:16:56.000Z (over 5 years ago)
- Last Synced: 2025-10-24T02:17:00.895Z (8 months ago)
- Topics: converter, odf, php, php7
- Language: PHP
- Homepage:
- Size: 90.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ODT2XHTML #
### 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? ###
* 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? ###
* 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? ###
* base code © 2007-2011 Stéphane HUC
* © 2020 Sergey Lebedev, licensed under the Apache License, Version 2.0
* Feel free to contact me at:
* https://habrahabr.ru/users/sunman/
* http://stackoverflow.com/users/7135046/sergeylebedev
* https://www.facebook.com/sergei.lebedev.5891