PHP code example of mlb0925 / php-unoconv

1. Go to this page and download the library: Download mlb0925/php-unoconv library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mlb0925 / php-unoconv example snippets


$unoconv = Unoconv\Unoconv::create();

$unoconv = Unoconv\Unoconv::create(array(
    'timeout'          => 42,
    'unoconv.binaries' => '/opt/local/unoconv/bin/unoconv',
), $logger);

$unoconv->transcode('document.docx', 'pdf', 'document.pdf');

// pages 1 to 14
$unoconv->transcode('document.docx', 'pdf', 'document.pdf', '1-14');

$app = new Silex\Application();
$app->register(new Unoconv\UnoconvServiceProvider(), array(
    'unoconv.configuration' => array(
        'unoconv.binaries' => '/opt/local/unoconv/bin/unoconv',
        'timeout'          => 42,
    ),
    'unoconv.logger'  => $app->share(function () {
        return $app['monolog']; // use Monolog service provider
    }),
));
JSON
{
    "lb0925/php-unoconv": "~0.2"
    }
}