【发布时间】:2016-07-01 21:39:30
【问题描述】:
我正在尝试做一个页面组,虽然它不起作用。现在它正在做第 1 页,共 4 页。我需要它按组对页面进行编号。所以总共会有 4 页,我需要第 1 页,共 2 页,然后从第 1 页,共 2 页开始。 类 ManafestPrint 扩展 TCPDF {
//Page header
public function Header()
{
global $pickUpDate;
// Set font
$this->SetFont('helvetica', 'B', 20);
// Title
$titleHTML = '
<table width="100%" border="0" style="font-weight: bold; font-size: 9pt;">
<tr>
<td width="25%" align="left">PICK UP DATE: '.$pickUpDate.'</td>
<td width="50%" align="center" style="font-size: 16pt;">SHIPPING MANIFEST</td>
<td width="25%" align="right">Page '.$this->getAliasNumPage().' of '.$this->getAliasNbPages().'</td>
</tr>
</table>
';
$this->writeHTMLCell(280, 25, 7, 5, $titleHTML);
}
}
这是我的页面布局
$pdf = new ManifestPrint('L', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetMargins(0, 12, 0);
$pdf->SetAutoPageBreak(true, 10);
$pdf->startPageGroup();
$pdf->AddPage();
$pdf->writeHTMLCell(280, 0, 5, 15, $shipperCarierData, 0, 0, false, true, 'C', true);
$pdf->writeHTMLCell(280, 0, 3, 35, $tableData, 0, 0, false, true, 'C', true);
$pdf->AddPage();
$pdf->lastPage();
$pdf->writeHTMLCell(280, 0, 5, 160, $disclaimerHTML, 0, 0, false, true, 'C', true);
$pdf->startPageGroup();
$pdf->AddPage();
$pdf->writeHTMLCell(280, 0, 5, 15, $shipperCarierData1, 0, 0, false, true, 'C', true);
$pdf->writeHTMLCell(280, 0, 3, 35, $tableData1, 0, 0, false, true, 'C', true);
$pdf->AddPage();
$pdf->lastPage();
$pdf->writeHTMLCell(280, 0, 5, 160, $disclaimerHTML, 0, 0, false, true, 'C', true);
$pdf->Output('print_manifest.pdf', 'I');
【问题讨论】: