PHP code example of gabrielchavezme / pdf-table-of-content

1. Go to this page and download the library: Download gabrielchavezme/pdf-table-of-content 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/ */

    

gabrielchavezme / pdf-table-of-content example snippets


$pdfMerge = new PdfTableOfContent();

$pdfMerge->add([
    'file' => '/path/to/file1.pdf',
    'title' => 'File 1',
    'id' => 1
]);
$pdfMerge->add([
    'file' => '/path/to/file2.pdf',
    'title' => 'File 2',
    'id' => 2
]);

$pdfMerge->merge('/path/to/output.pdf');

$pdfMerge->contains('/path/to/file.pdf');