如何设置起始页码?这是我在dompdf中的代码:
<script type="text/php">
if (isset($pdf)) {
$pdf->page_script('
if ($PAGE_COUNT > 1) {
$font = $fontMetrics->getFont("TimesNewRoman", "regular");
$pdf->page_text(515, 50, "{PAGE_NUM}", $font, 11, array(.5,.5,.5));
}
');
}
</script>
如果我想将{PAGE_NUM}的值设置为从数字10开始。
答案 0 :(得分:0)
好吧,我使用此代码
解决了这个问题<script type="text/php">
if ( isset($pdf) ) {
$pdf->numPage='{{$numPag}}';
$pdf->page_script('
if ($PAGE_NUM > 1 ) {
$pdf->numPage++;
$font = $fontMetrics->getFont("TimesNewRoman", "regular");
$pdf->text(510, 50, $pdf->numPage, $font, 11, array(.5,.5,.5));
}
');
}
</script>