Page number is 0 in PDF TOC when using page-style=book with weasyprint
Hi Norm,
up to now i used the Antenna House Formatter for rendering HTML paged media (created with print.xsl instead of docbook.xsl) without problems. But i am sure that many users will not (or can not) purchase a commercial product. I am sure that it must be possible to use the xslTNG Stylesheets with some open-source or cost-free products to get PDF output.
I tried weasyprint and the results are very promising. But there is an issue with page numbers in the TOC (and other target-counter (page) references: they give not the real page number, but a 0 (zero) instead. The good news is: this happens only when i set the page-style parameter to book. Page numbers are correct when article is used as page-style. This means that it is possible in principle, and that there mus be an issue with CSS when in book style.
I have made samples with book style and article style and a fresh installation of xslTNG 2.2.0.
Unfortunately i have only little knowledge about CSS, so i will not be able to make a PR for this issue.
Greetings, Frank
Hello!
The bug is caused by:
html.book-style .book .list-of-titles {
counter-reset: page;
}
I suppose that the bug is in WeasyPrint … but as always with page counters, I’m not sure yet. 😄
As a workaround, you can override this rule with an extra
html.book-style .book .list-of-titles {
counter-reset: none;
}
See also #433
If you’re interested in solving the bug in WeasyPrint (if there’s a bug!), don’t hesitate to open an issue on WeasyPrint’s repository.