Generating header/footer with flying saucer (xHTMLRenderer) and iText

后端 未结 3 1224
野的像风
野的像风 2020-12-08 10:57

I realize this question has been asked before (I looked at all the solutions and tried them all) but I am still trying to generate a pdf document with a header and footer th

3条回答
  •  眼角桃花
    2020-12-08 11:21

    After researching and testing a lot, I just came up with a solution that really works.

    You can control:

    - header height by editing margin-top;

    - footer height by editing margin-bottom;

    - content width by editing div.content width.

    Page numbers are displayed at footer.

    See code below:

    
    
    
    
    
    
        
    This is the header that will repeat on every page at top

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    This is the content

    Hope it helps!!!

提交回复
热议问题