Render .odt files with Blade, convert to pdf with Libre/OpenOffice

Maintainers

Details

github.com/petecoop/odt

Source

Issues

Installs: 819

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/petecoop/odt

0.3.1 2023-09-21 13:25 UTC

This package is auto-updated.

Last update: 2025-10-10 16:28:56 UTC


README

Compile ODT files with Blade.

composer require petecoop/odt

use Petecoop\ODT\Facades\ODT;

ODT::open(resource_path('file.odt'))
    ->render([
        'some' => 'arguments'
    ])
    ->symfonyResponse('file.odt');

Output as PDF

Libreoffice or OpenOffice must be installed and the path to the soffice binary must be given.

ODT::open(resource_path('file.odt'))
    ->render([
        'some' => 'arguments'
    ])
    ->saveAsPDF('/tmp/output.pdf', 'path/to/soffice');

Tables

When in Libre/Open Office you can't wrap a @foreach around a table row - use @beforerow / @endbeforerow and @afterrow / @endafterrow

@beforerow@foreach ($users as $user)@endbeforerow
{{ $user->name }}
@afterrow@endforeach@endafterrow