mnvx / unoconv-laravel by mnvx

Laravel Unoconv for Laravel 5
355
1
2
Package Data
Maintainer Username: mnvx
Package Create Date: 2017-01-15
Package Last Update: 2017-01-15
Language: PHP
License: MIT
Last Refreshed: 2024-11-26 15:25:04
Package Statistics
Total Downloads: 355
Monthly Downloads: 5
Daily Downloads: 0
Total Stars: 1
Total Watchers: 2
Total Forks: 1
Total Open Issues: 1

Laravel Unoconv for Laravel 5

Simple way for documents conversion into various formats.

For example: html -> docx, html -> pdf, docx -> html and many more.

Usage

Using service provider:

use Illuminate\Support\Facades\App;
use Mnvx\Unoconv\ConverterInterface;
use Mnvx\Unoconv\Format;
use Mnvx\Unoconv\UnoconvParameters;

$converter = App::make(ConverterInterface::class);
$parameters = (new UnoconvParameters())
    ->setInputStream('test text')
    ->setOutputFormat(Format::FORMAT_TEXT_HTML);
echo $converter->convert($parameters);

Using facade:

use Mnvx\Unoconv\Format;
use Mnvx\Unoconv\UnoconvParameters;
use Mnvx\UnoconvLaravel\Facades\Converter;

$parameters = (new UnoconvParameters())
    ->setInputStream('test text')
    ->setOutputFormat(Format::FORMAT_TEXT_HTML);
echo Converter::convert($parameters);

Installation

composer require mnvx/unoconv-laravel

More about PHP wrapper over Unoconv