Somehow getAliasNumPage()
and getPageNumGroupAlias()
add a bunch of whitespace to the right. I am unsure why. But I know that using PageNo()
and getGroupPageNo()
instead will fix it.
This is the code that worked for me:
public function Footer() {
$this->SetY(-15); //not present in your code but was necessary for me to have the footer be positioned correctly
$txt = 'Page %s of %s';
if (empty($this->pagegroups)) {
$txt = sprintf($txt, $this->PageNo(), $this->getAliasNbPages());
} else {
$txt = sprintf($txt, $this->getGroupPageNo(), $this->getPageGroupAlias());
}
$this->MultiCell(0, 0, $txt, 1, 'C', false, 1);
}
}