Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mnvx/unoconv
PHP wrapper over Unoconv
https://github.com/mnvx/unoconv
docx docx-generator html libreoffice-converter pdf pdf-generation unoconv
Last synced: 10 days ago
JSON representation
PHP wrapper over Unoconv
- Host: GitHub
- URL: https://github.com/mnvx/unoconv
- Owner: mnvx
- Created: 2017-01-14T22:35:59.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-01-29T05:03:16.000Z (11 months ago)
- Last Synced: 2024-12-14T15:09:06.574Z (22 days ago)
- Topics: docx, docx-generator, html, libreoffice-converter, pdf, pdf-generation, unoconv
- Language: PHP
- Homepage:
- Size: 613 KB
- Stars: 3
- Watchers: 2
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP wrapper over Unoconv
Simple way for documents conversion into various formats.For example: html -> docx, html -> pdf, docx -> html and many more.
More about [supported formats](http://dag.wiee.rs/home-made/unoconv/).
## Usage
```
use Mnvx\Unoconv\Converter;
use Mnvx\Unoconv\UnoconvParameters;
use Mnvx\Unoconv\Format;// Create converter
$converter = new Converter();// Describe parameters for converter
$parameters = (new UnoconvParameters())
// HTML document as string on input
->setInputStream('Example of HTML document')
// Result file name
->setOutputFile('path-to-result-docx.docx')
// Format of result document is docx
->setOutputFormat(Format::FORMAT_TEXT_DOCX);// Run converter
$converter->convert($parameters);
```## Install
```
sudo apt-get install unoconv
composer require mnvx/unoconv
```If you have problems with Unoconv utility, read instructions descibed
in [official documentation](https://github.com/dagwieers/unoconv#problems-running-unoconv-from-nginxapachephp).## License
Released under the MIT license