2017-06-16 67 views
0

如何設置起始頁碼?這是我在DOMPDF代碼:Laravel 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

好開始,我解決它使用此代碼

<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>