HTML generated Microsoft Word document with header, footer and watermark

后端 未结 3 1786
伪装坚强ぢ
伪装坚强ぢ 2020-12-01 03:58

I\'m looking for an example of a Microsoft Word Document generated by HTML. It should contain a header, footer and a watermark.

3条回答
  •  日久生厌
    2020-12-01 04:33

    The below example:

    • is very concise as it strips extra HTML tags and provides an example with about half the lines of code vs other answers
    • relegates the extra required space for the header/footer element down to 1pt (other answers add several centimeters of invisible content to your doc, which often will cause an extra blank page to appear at the end)
    • locates the header/footer code at the top of your content, which is a much better location since it won't change regardless of content length
    • contains working examples of using page number references (some other answers' reference code is broken)
    
    
        
    
    

    Header content goes here

     

    Page of

     
    Main content goes here. Here's a page break:
    This is page 2

提交回复
热议问题