0
我正在使用TCPDF來呈現通過一系列HTML表格生成的報告。這些表格包含一些我想從Footer()方法解析並添加到當前頁面頁腳的跟蹤代碼。任何想法如何從TCPDF獲取當前頁面的HTML代碼?如何從TCPDF中的Footer()方法檢索當前頁面的HTML代碼?
基本上,我這樣做:
class SVNPDF extends TCPDF {
// Page footer
public function Footer() {
// Position at 15 mm from bottom
$this->SetY(-15);
// Set font
$this->SetFont('helvetica', 'I', 10);
// Page number
$this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'R', 0, '', 0, false, 'T', 'M');
$this->SetY(-15);
$this->SetFont('helvetica', 'I', 10);
$this->Cell(0, 10, 'Picking #'.$glb_picking_num.'', 0, false, 'L', 0, '', 0, false, 'T', 'M');
// HERE I NEED TO RETRIEVE CURRENT PAGE HTML CONTENT AND EXTRACT THE TRACKING NUMBER INSIDE FOR DISPLAY IN CURRENT FOOTER
}
}
$report = 'SOME LONG HTML CODE HERE';
$pdf = new SVNPDF('L', 'mm', 'A4', true, 'UTF-8', false);
$pdf->AddPage();
$pdf->writeHTML($report, true, false, true, false, '');
$pdf->Output(dirname(__FILE__) . '/test.pdf', 'I');