Do you intend to one day support all the paged media bits in pagedjs? I assume it works with their polyfill but it’d be great to have a built in more performant option.
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.
Things like string-set and string (repeating section headers on each page), counter and target-counter (embedding page number references) etc. Prince and pagedjs support all the CSS3 paged media bits I've found myself needing, just wondering if that was on the roadmap.
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>
</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.