dompdf page number

前端 未结 2 636
旧巷少年郎
旧巷少年郎 2020-12-17 01:44

Hi I am using DOMPDF to generate PDF file, I would like to know how to get page number.

I have try the following as mention in FAQ page of DOMPDF. and not successful

2条回答
  •  -上瘾入骨i
    2020-12-17 02:27

    You are running your inline script as part of the PHP page instead of passing it to dompdf. Your code could be written as follows (truncated to the relevant section):

    ...
    $html="
    
      
        
    ";
    ...
    

    Note that inline script must currently appear inside the BODY element. Otherwise it will be ignored during document processing.

    There are other ways to achieve what you want as well.

提交回复
热议问题