How can you delete the last page of a multi-page PDF created with FPDF?

To delete the last page of a multi-page PDF created with FPDF, you can use the `AddPage()` method to add a new blank page at the end of the document, and then use the `DeletePage()` method to remove the last page. This can be achieved by first counting the total number of pages in the PDF and then deleting the last page by passing the page number as an argument to the `DeletePage()` method.

<?php
require('fpdf.php');

$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Page 1');

$pdf->AddPage();
$pdf->Cell(40,10,'Page 2');

$pdf->AddPage();
$pdf->Cell(40,10,'Page 3');

$totalPages = $pdf->PageNo();
$pdf->DeletePage($totalPages);

$pdf->Output();
?>