1
我正在使用TCPDF
供應商軟件包在CakePHP應用程序中生成PDF報告。 我必須在生成的PDF的每個頁面上創建頁面邊框。TCPDF - 所有頁面中的頁面邊框
我使用this solution來製作頁面邊框,但只能在生成的PDF的第一頁上繪製邊框。
我使用下面的代碼:
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->AddPage();
$pdf->SetLineStyle(array('width' => 15, 'color' => array(0,0,0)));
$pdf->Line(0,0,$pdf->getPageWidth(),0);
$pdf->Line($pdf->getPageWidth(),0,$pdf->getPageWidth(),$pdf->getPageHeight());
$pdf->Line(0,$pdf->getPageHeight(),$pdf->getPageWidth(),$pdf->getPageHeight());
$pdf->Line(0,0,0,$pdf->getPageHeight());
//rest of my code to make proper Html
.....
.....
$pdf->writeHTML($content_html, true, 0, true, 0); //$content_html contains the whole Html which outputs me several PDF pages
ob_clean();
$pdf_status = $pdf->Output($directory_path.$file_name.EXT_PDF, 'F'); // save pdf on the given path
請建議的解決方案。任何幫助,將不勝感激。
通過你是它的外觀在頁面1上繪製邊框,然後編寫多頁HTML。您不會在任何地方告訴它在其餘頁面上寫入邊框。我不相信這是可能的。 –
@MichaelDeMutis,是的,我想要如何在其餘頁面上書寫邊框。 –