Weasyprint: Changing header on reports by defining a html tag/id #request

Created on 14 Jun 2020  Â·  3Comments  Â·  Source: Kozea/WeasyPrint

Right now, when I use the reports template, the upper rightmost header text is the same as the chapter<h2> header text. However, I rather want an uniform header text (f.ex date and company name). It would be great if you could define a <p class="header">headertext</p>that was invisible, but was put in place as the header text by WeasyPrint.

CSS question

All 3 comments

Hi!

I think that what you want is running elements, and … it’s already in WeasyPrint :wink:.

Let me know if it works for you!

Running elements is what you are looking for:

  @page { 
    @top-center { content: element(myheader) }
  }
 .header { 
    position: running(myheader); 
 }

Thank you- that is 100% what I was after. Came in here to close this, sorry for this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elyak123 picture elyak123  Â·  3Comments

zopyx picture zopyx  Â·  5Comments

jeffgabhart picture jeffgabhart  Â·  3Comments

SimonSapin picture SimonSapin  Â·  4Comments

assuntaw picture assuntaw  Â·  3Comments