【发布时间】:2014-02-28 18:49:31
【问题描述】:
我正在尝试使页脚文本居中
function Footer(){
$txt = 'Page %s of %s';
if (empty($this->pagegroups)) {
$txt = sprintf($txt, $this->getAliasNumPage(), $this->getAliasNbPages());
} else {
$txt = sprintf($txt, $this->getPageNumGroupAlias(), $this->getPageGroupAlias());
}
$this->MultiCell(0, 0, $txt, 1, 'C', false, 1, PDF_MARGIN_LEFT, $this->y);
}
正如您在图像中看到的那样,单元格的位置正确,问题在于文本居中。
如果我将 MultiCell 更改为更直接的东西,我会得到相同的结果:
$this->SetXY(PDF_MARGIN_LEFT, $this->y);
$this->Cell(0, 0, $txt, 1, 1, 'C');
【问题讨论】: