Can you give an example? I'm not that familiar with pagedjs, just pulled it for the benchmark.
My library has support for @page rules, but that's actually pretty basic. I needed more advanced headers/footers and added support for in-html headers/footers like this:
In your <body> you cna define headers/footers by wrapping content in a <section> tag. For example:
<body>
<section>
<header>... any HTML here, full CSS support</header>
<div> Some normal flow content</div>
<footer>Your footer HTML</footer>
</section>
</body>
This structure is purely optional, but it's a really convinient way of designing pages with different styles in the same document.
An HTML file can have any number of these sections meaning you can generate a PDF with different headers/footers.
Some other bits: It has support for 100% height that match the entire page, it can handle forced page breaks inside flexbox containers (Chrome doesn't even try ... just ignores it) and also follows page-break: avoid correctly - so it doesn't randomly split table rows for example.