PHP code example of langleyfoxall / pdf-stitcher

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

    

langleyfoxall / pdf-stitcher example snippets


(new PdfStitcher)
    ->addPdf('firstDocument.pdf')
    ->addPdfs(['secondDocument.pdf', 'yetAnotherDocument.pdf'])
    ->save('destinationDocument.pdf');

new PdfStitcher('a/path/to/a/gs/executable')

new PdfStitcher(null, '-dNEWPDF=false')

(new PdfStitcher)
    ->addPdf('firstDocument.pdf', [0, 2, 3, 5])
    ->save('destinationDocument.pdf');