I'm creating a PDF using TCPDF, specifically with FPDI for importing pages. My document includes a footer displaying the current page number and the total number of pages like so:
$this->Cell(0, 5, $this->PageNo() . "/" . $this->getAliasNbPages, 0, 1, 'L');
However, I'm encountering an issue after adding a PDF to the end of my document using importPage() from FPDI. This added PDF serves as an "attachment" and I prefer not to count its pages in the total page count displayed in the footer.
I tried modifying the getAliasNbPages() variable but realized it's just an alias updated by TCPDF at the document's completion, thus it cannot be directly manipulated as an integer. I looked for a setting that would allow me to exclude certain pages from the total count but found none. Manual page counting was considered, but then I wouldn't be able to retroactively update the footer on earlier pages.
So... are there any solutions to exclude pages from the total count in the footer?
I also considered generating the PDF with TCPDF and then merging it with the attachment using PDFMerger. However, this approach introduces compatibility issues with my application, rendering it unfeasible.