Creating page headers and footers using CSS for print

后端 未结 3 728
慢半拍i
慢半拍i 2020-12-02 07:30

I\'m creating a PDF using Flying Saucer (which dumps out CSS/HTML to iText to a PDF) and I\'m trying to use CSS3 to apply an image header and footer to each page.

I

3条回答
  •  -上瘾入骨i
    2020-12-02 08:24

    Putting an element to the top of each page:

    @page {
      @top-center {
        content: element(pageHeader);
      }
    }
    #pageHeader{
      position: running(pageHeader);
    }
    

    See http://www.w3.org/TR/css3-gcpm/#running-elements (works in Flying Saucer)

提交回复
热议问题