0.0.1 2022-07-28 14:15 UTC

This package is auto-updated.

Last update: 2024-02-28 17:29:32 UTC


A PHP wrapper around Libreoffice for converting documents from one format to another.

For example:

  • Microsoft Word to PDF
  • OpenOffice to Microsoft Word
  • PDF to HTML
  • ...and many more


IMPORTANT: You must have Libreoffice installed.

Using composer:

composer require lukaswhite/document-converter


use Lukaswhite\DocumentConverter\Converter;

$converter = new Converter('/path/to/document.doc');

All being well, this should create a file named document.pdf in the same folder.

To customize the filename:


...or the output path:


You can of course combine these:


For other formats:


Return Format

The conversion method returns an object that contains information about the conversion:

$result = $converter->toPDF();

$result->getFilepath(); // e.g. /path/to/document.pdf
$result->getFilename(); // e.g. document.pdf
$result->getExtension(); // e.g. pdf