officeconverter / office-converter
PHP Wrapper for LibreOffice
v1.1.0
2020-03-16 15:48 UTC
Requires
- php: >=7.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- phpstan/phpstan: ^0.12.11
- phpunit/phpunit: 7.*
This package is auto-updated.
Last update: 2024-06-17 01:46:36 UTC
README
Office Converter ![Build Status](https://camo.githubusercontent.com/cfceb7c50606da910ac7dac46c18d5ead1f37f1188f884ca6e5d5a5f09858cc5/68747470733a2f2f7472617669732d63692e6f72672f4f6666696365436f6e7665727465722f6f66666963652d636f6e7665727465722e7376673f6272616e63683d6d6173746572)
Preamble
This repository is a fork of ncjoes/office-converter. This repository seems to be abandoned.
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.
Run this command within your project directory
composer require officeconverter/office-converter
Dependencies
In order to use OfficeConverter, you need to install LibreOffice.
Usage
Here are some samples.
<?php // if you are using composer, just use this use OfficeConverter\OfficeConverter; $converter = new OfficeConverter('test-file.docx'); $converter->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.
Feedback & Contribute
Notify me of any issues, bugs, or improvements. Thanks 👍