1.需要給生成的pdf添加頁眉和頁腳
解決辦法
@page { margin: 180px
50px; }
#header { position:
fixed; left: 0px; top: -180px; right: 0px; height: 150px;
background-color: orange; text-align: center; }
#footer { position:
fixed; left: 0px; bottom: -180px; right: 0px; height: 150px;
background-color: lightblue; }
#footer .page:after {
content: counter(page, upper-roman); }
//頁腳需要顯示總頁數及當前頁數
if (
isset($pdf) )
{
$font = Font_Metrics::get_font("yourfont",
"normal");
$size = 9;
$y = $pdf->get_height() -
24;
$x = $pdf->get_width() -
15 -
Font_Metrics::get_text_width("1/1",
$font,
$size);
$pdf->page_text($x, $y, "{PAGE_NUM}/{PAGE_COUNT}",
$font,
$size);}