PHP code example of ronisaha / easy-merge2pdf
1. Go to this page and download the library: Download ronisaha/easy-merge2pdf 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/ */
ronisaha / easy-merge2pdf example snippets
new \EasyMerge2pdf\Merger(['auto' => true]);
or
$m = new \EasyMerge2pdf\Merger(['binary' => '/path/to/merge2pdf']);
$m->addInput('/path/to/input.pdf', '1,3-8,2,1');
try {
$m->merge('/path/to/out.pdf');
} catch (Exception $exception) {
echo $exception->getMessage();
}