Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page number is 0 in PDF TOC when using page-style=book with weasyprint #497

Open
fsteimke opened this issue Mar 29, 2024 · 3 comments
Open

Comments

@fsteimke
Copy link
Contributor

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.

sample.zip

Unfortunately i have only little knowledge about CSS, so i will not be able to make a PR for this issue.

Greetings, Frank

@liZe
Copy link

liZe commented Mar 31, 2024

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;
}

@ndw
Copy link
Contributor

ndw commented Mar 31, 2024

See also #433

@liZe
Copy link

liZe commented Apr 2, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants