https://github.com/ncjoes/office-converter
PHP Wrapper for LibreOffice
https://github.com/ncjoes/office-converter
Last synced: 4 months ago
JSON representation
PHP Wrapper for LibreOffice
- Host: GitHub
- URL: https://github.com/ncjoes/office-converter
- Owner: ncjoes
- License: mit
- Created: 2016-11-13T02:02:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-11-06T18:16:13.000Z (over 1 year ago)
- Last Synced: 2026-02-22T18:11:32.443Z (4 months ago)
- Language: PHP
- Size: 138 KB
- Stars: 241
- Watchers: 11
- Forks: 84
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-php - Office Convertor - PHP Wrapper for LibreOffice (MIT) (Table of Contents / Globalization)
README
# Office Converter
#### PHP Wrapper for LibreOffice
Convert offices files to PDF and HTML using LibreOffice or OpenOffice.
Supported conversion formats include:
* pptx => pdf
* ppt => pdf
* pdf => pdf
* docx => pdf, odt, html
* doc => pdf, odt, html
* xlsx => pdf
* xls => pdf
* png => pdf
* jpg => pdf
* jpeg => pdf
### Installation
It is recommended to install OfficeConverter through [Composer](http://getcomposer.org/).
Run this command within your project directory
```shell
composer require ncjoes/office-converter
```
### Dependencies
In order to use OfficeConverter, you need to install [LibreOffice](http://www.libreoffice.org/).
### Usage
Here are some samples.
```php
convertTo('output-file.pdf'); //generates pdf file in same directory as test-file.docx
$converter->convertTo('output-file.html'); //generates html file in same directory as test-file.docx
//to specify output directory, specify it as the second argument to the constructor
$converter = new OfficeConverter('test-file.docx', 'path-to-outdir');
?>
```
### License
The OfficeConverter package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).
### Feedback & Contribute
Notify me of any issues, bugs, or improvements. Thanks :+1: