如何仅显示TCPDF第二页中的页数

时间:2019-05-31 20:22:31

标签: footer tcpdf

如何在tcpdf中仅显示第二页的页数?

如何居中显示页数?

我用这个班

private $customFooterText = "";

/**
 * @param string $customFooterText
 */
public function setCustomFooterText($customFooterText)
{
    $this->customFooterText = $customFooterText;
}

public function Footer()
{   

    // Linha 1
    $this->SetY(-16);
    $this->SetFont('helvetica', 'I', 8);
    $this->Cell(0, 10, $this->customFooterText, 0, false, 'C', 0, '', 0, false, 'T', 'M');


    // Números de página
    $this->Cell(0, 10, 'Pag '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}

非常感谢!

1 个答案:

答案 0 :(得分:0)

我明白了!

$pageN = TCPDF::PageNo();
    if($pageN == 1){
        //if page is 1... don't print anything
        return;
    }else{
        $this->Cell(0, 10, $this->getAliasNumPage(), 0, false, 'C', 0, '', 0, false, 'T', 'M');