PHP code example of eboost / unoconv
1. Go to this page and download the library: Download eboost/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/ */
eboost / unoconv example snippets
'providers' => [
...
Eboost\Unoconv\UnoconvServiceProvider::class
]
'aliases' => [
...
'Unoconv' => Eboost\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="Eboost\Unoconv\UnoconvServiceProvider" --tag="config"