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); }
$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
);
}
解决办法
Widgets Express
//页脚需要显示总页数及当前页数
if
(
isset
(
$pdf
)
)
{
the first page
the second page