use setasign\Fpdi;
require_once('tcpdf_include.php');
require_once('../FPDI/src/autoload.php');
// Original file with multiple pages
$fullPathToFile = '../sample.pdf';
class Pdf extends Fpdi\TcpdfFpdi{
var $_tplIdx;
}
$pdf = new pdf('P', 'px', 'A4', true, 'UTF-8', false);
$page1='<table cellpadding="5" cellspacing="2" style="font-size:11px;font-family:Arial;">
</table>';
$pdf->writeHTMLCell($colWidth,300,$margin,$pagetopmargin,$page1);
$page2='';
$pdf->AddPage();
//$pdf->writeHTMLCell(235,232,495,10,$manageLogo);
$pdf->writeHTMLCell($colWidth,300,$margin,$pagetopmargin,$page2);
// THIS IS WHERE YOU GET THE NUMBER OF PAGES
$pdf -> setSourceFile('../sample.pdf');
$temp =$pdf->importPage(1);
$pdf->AddPage();
$pdf->useTemplate($temp);
$pdf->SetMargins(30, 60, 50, true);
$pdf -> setSourceFile('../sample.pdf');
$temp =$pdf->importPage(2);
$pdf->AddPage();
$pdf->useTemplate($temp ,-4, 30);
$page3=' <h4>Ongoing Rent Payments</h4>
<p>Our preferred payment method for rent is Rental Rewards. (Please note that there is a small convenience fee charged for the use of the system. These fees are charged by a third-party payment processor – Rental Rewards</p> <p>The fees for the convenience of the use of the services are: (must be able to set-up fee at agent level, as there is variation)</p> <ol type="a" style="margin-left: 20px;">';
$pdf->AddPage();
$pdf->writeHTMLCell($colWidth,300,$margin,$pagetopmargin-20,$page3);
ob_end_clean();
$pdf->Output('tenancy_application.pdf');