1. Go to this page and download the library: Download raudius/phpdf 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/ */
// Combine 3 PDF files into 1
$pdf_merged = (new Merge([
Phpdf::fopen('file1.pdf'),
Phpdf::fopen('file2.pdf'),
Phpdf::fopen('file3.pdf')
]))->execute();
// Keep just the 1st, 3rd and 4th pages.
(new Trim($pdf_merged, '1,3,4'))->execute($pdf_merged);