- Notifications
You must be signed in to change notification settings - Fork38
PHP wrapper over LibreOffice converter
License
NotificationsYou must be signed in to change notification settings
mnvx/lowrapper
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Simple way for documents conversion into various formats.
For example: html -> docx, html -> pdf, docx -> html and many more.
useMnvx\Lowrapper\Converter;useMnvx\Lowrapper\LowrapperParameters;useMnvx\Lowrapper\Format;// Create converter$converter =newConverter();// Describe parameters for converter$parameters = (newLowrapperParameters())// 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);
Moreexamples
- PHP 5.5+
- libreoffice-core
sudo add-apt-repository ppa:libreoffice/ppasudo apt-get updatesudo apt-get install default-jdk -ysudo apt-get install python-software-properties -ysudo apt-get install software-properties-common -ysudo apt-get install libreoffice-core --no-install-recommendssudo apt-get install libreoffice-writercomposer require mnvx/lowrapper
Example of installation libreoffice into docker container:
FROM php:7.2-fpmWORKDIR /var/www/html# Install libreoffice headlessRUN apt update -y \ && mkdir -p /usr/share/man/man1 \ && apt -y install default-jdk-headless libreoffice-core libreoffice-writer libreoffice-calcRUN mkdir -p /var/www/.cache/dconf \ && mkdir -p /var/www/.config/libreoffice \ && chmod -R ugo+rwx /var/www/.cache \ && chmod -R ugo+rwx /var/www/.config
./vendor/bin/phpunit
Released under the MIT license
About
PHP wrapper over LibreOffice converter
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published