alexlist / lowrapper
PHP wrapper over LibreOffice converter
1.0.0
2019-10-20 18:09 UTC
Requires
- php: >=5.5
- psr/log: ^1.0
- symfony/process: ^3.1 || 4.*
Requires (Dev)
- phpunit/phpunit: ^4.0
This package is not auto-updated.
Last update: 2025-01-21 17:07:35 UTC
README
PHP wrapper over LibreOffice converter
Simple way for documents conversion into various formats.
For example: html -> docx, html -> pdf, docx -> html and many more.
Usage
use Mnvx\Lowrapper\Converter; use Mnvx\Lowrapper\LowrapperParameters; use Mnvx\Lowrapper\Format; // Create converter $converter = new Converter(); // Describe parameters for converter $parameters = (new LowrapperParameters()) // HTML document ->setInputFile('test.html') // Format of result document is docx ->setOutputFormat(Format::TEXT_DOCX) // Result file name ->setOutputFile('path-to-result-docx.docx'); // Run converter $converter->convert($parameters);
More examples
Requirements
- PHP 5.5+
- libreoffice-core
Installation
sudo add-apt-repository ppa:libreoffice/ppa sudo apt-get update sudo apt-get install default-jdk -y sudo apt-get install python-software-properties -y sudo apt-get install software-properties-common -y sudo apt-get install libreoffice-core --no-install-recommends sudo apt-get install libreoffice-writer composer require mnvx/lowrapper
License
Released under the MIT license