Header in PDF page using DOMPDF in PHP

前端 未结 3 2016
终归单人心
终归单人心 2020-11-27 02:26

I am creating a PDF file using DOMPDF. I have a big content to extract in PDF, we need some header in all the pages. So can anyone telme how to add a header and footer in th

3条回答
  •  时光说笑
    2020-11-27 03:30

    In the 0.6.0 code you will be able to use HTML+CSS to generate headers and footers. There are a few limitations when compared to using inline PHP (e.g. no PAGE_COUNT placeholder yet), so whether or not this is viable depends on your needs.

    The following code will produce a two-page document with a header and footer:

    
    
      
    
      
      
      

    the first page

    the second page

    You could also use a combination of the two styles if you needed access to some of the missing functionality. PDF objects and text added using the page_text method render on top of the HTML content.

提交回复
热议问题