Php Laravel Dompdf设置起始页码
如何设置起始页码?这是我在dompdf中的代码:Php Laravel Dompdf设置起始页码,php,laravel,dompdf,Php,Laravel,Dompdf,如何设置起始页码?这是我在dompdf中的代码: <script type="text/php"> if (isset($pdf)) { $pdf->page_script(' if ($PAGE_COUNT > 1) { $font = $fontMetrics->getFont("TimesNewRoman", "regular");
<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>
如果(isset($pdf)){
$pdf->page_脚本($pdf)
如果($PAGE_COUNT>1){
$font=$fontMetrics->getFont(“TimesNewRoman”、“regular”);
$pdf->page_text(515,50,{page_NUM},$font,11,数组(.5,5,5));
}
');
}
如果我想将{PAGE_NUM}的值设置为从数字10开始。好的,我用下面的代码解决了这个问题
<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>
如果(isset($pdf)){
$pdf->numPage='{{$numPag}}';
$pdf->page_脚本($pdf)
如果($PAGE_NUM>1){
$pdf->numPage++;
$font=$fontMetrics->getFont(“TimesNewRoman”、“regular”);
$pdf->text(510,50,$pdf->numPage,$font,11,数组(.5,5,5));
}
');
}