'Weasyprint content to take up entire available height

I am trying to build an invoice template and I am trying weasyprint for this. I have a header which runs on to all pages. and I have a body with content and a footer.

The CSS goes something like this:

@page {
        size: A5 landscape;
        margin: 200px 20px 10px 10px;
        @top-left {
          content: element(header);
          width: 100%;
        }
        @bottom-left {
          content: element(footer);
          width: 100%;
        }
      }

header {
        position: running(header);
      }

What I want is to display the footer at the bottom of the last page where the body content ends. which is not a running element and to be displayed at the end of the content only.

How can I possibly achieve that?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source