PHP code example of doode / pdf-fusion-laravel

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

    

doode / pdf-fusion-laravel example snippets


'providers' => [
   ...
   Doode\PdfFusionLaravel\Providers\PdfFusionServiceProvider::class
],

'aliases' => [
   ...
   'PdfFusion' => Doode\PdfFusionLaravel\Facades\PdfFusionFacade::class
]

$fusion->addPathToPDF('/path/to/pdf', 'all', 'P');
$fusion->addPDFString(file_get_contents('path/to/pdf'), ['1', '2'], 'L')

$merger->setFileName('output.pdf');

$fusion->merge();
$fusion->inline();

$fusion = \PdfFusion::init();
$fusion->addPathToPDF(base_path('/vendor/doode/pdf-fusion-laravel/examples/one.pdf'), [2], 'P');
$fusion->addPDFString(file_get_contents(base_path('/vendor/doode/pdf-fusion-laravel/examples/two.pdf')), 'all', 'L');
$fusion->merge();
$fusion->save(public_path('/pdfs/output.pdf'));