breadlesscode / office-converter
Convert office documents to something else
v1.0.2
2018-01-03 14:02 UTC
Requires
- php: ^7.0
- spatie/temporary-directory: ^1.0.0
- symfony/process: ^3.3
Requires (Dev)
- codedungeon/phpunit-result-printer: ^0.4.4
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2024-11-30 01:57:44 UTC
README
This package is for converting office formats to something else. You can generate Thumbnails, PDFs etc..
Requirements
- LibreOffice for the convertion.
- PHP >= 7.1
Which extension can be converted to what?
You can check the following files:
Installation
This package can be installed through Composer.
composer require breadlesscode/office-converter
How to use
use \Breadlesscode\Office\Converter; Converter::file('Test.odt') // select a file for convertion ->setLibreofficeBinaryPath('/usr/bin/libreoffice') // binary to the libreoffice binary ->setTemporaryPath('./temp') // temporary directory for convertion ->setTimeout(100) // libreoffice process timeout ->save(__DIR__.'/lorem.pdf'); // save as pdf
Examples
Save with original name in folder
use Breadlesscode\Office\Converter; Converter::file('./Test.odt') ->save('./lorem', 'jpg');
Save with custom name
use Breadlesscode\Office\Converter; Converter::file('./Test.odt') ->save('./lorem.jpg');
Testing
$ composer test
License
The MIT License (MIT). Please see License File for more information.