PHP code example of petecoop / odt

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

    

petecoop / odt example snippets


use Petecoop\ODT\Facades\ODT;

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

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