PHP code example of fatiru / unoconv

1. Go to this page and download the library: Download fatiru/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/ */

    

fatiru / unoconv example snippets


'providers' => [
    ...
    Angusm73\Unoconv\UnoconvServiceProvider::class
]

'aliases'  => [
    ...
    'Unoconv' => Angusm73\Unoconv\Facades\Unoconv::class,
]

# Convert the file to /file.pdf

Unoconv::file('/file.pptx')->to('pdf');

# Convert the file and save it in a different location /new/location/file.pdf

Unoconv::file('/file.pptx')->to('/new/location/file.pdf');

# Convert the file to /file.pdf and /file.jpg

Unoconv::file('/file.pptx')->to(['pdf', 'jpg]);

# Convert the file to /file.pdf and /preview/file.jpg

Unoconv::file('/file.pptx')->to(['pdf', '/preview/file.jpg]);

Unoconv::file('/file.pptx')->queue('pdf');

# You can also specify the queue.

Unoconv::file('/file.pptx')->onQueue('image-converter', 'pdf');

Unoconv::file('/file.pptx')->after((new AfterConversionJob()))->to('pdf');
sh
php artisan vendor:publish --provider="Angusm73\Unoconv\UnoconvServiceProvider" --tag="config"