How can FPDI extension be used to manipulate existing PDF files in fpdf?

FPDI extension can be used with fpdf to import and manipulate existing PDF files. To use FPDI with fpdf, you need to include the FPDI library, create a new FPDI object, and then import the existing PDF file using the `setSourceFile()` method. Once the file is imported, you can access its pages and content to manipulate them as needed.

require_once('fpdf.php');
require_once('fpdi.php');

$pdf = new FPDI();
$pdf->AddPage();

$pageCount = $pdf->setSourceFile('existing_file.pdf');
$templateId = $pdf->importPage(1);
$pdf->useTemplate($templateId, 10, 10, 100);

$pdf->Output();