-
Notifications
You must be signed in to change notification settings - Fork 361
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
Bolded numeration for no reason #366
Comments
hi @acieplinski , you are right, it's a bug. I've tested in the sandbox (https://sandbox.openhtmltopdf.com/) and I can reproduce your issue. As a simple (and temporary) workaround, you can do the following, add a custom style to override the counter: <style>
ol {
list-style: none;
counter-reset: list-counter;
}
ol li {
counter-increment: list-counter;
}
ol li::before {
content: counter(list-counter) ". ";
font-weight: normal;
}
</style> |
Could you describe how do you 'inject' the styling? It should be in xhtml in header? Or there's a way to use an external stylesheet? |
@acieplinski I think that I would add it inline in the document. When you get the html string, you convert it in a dom tree, create the style element, add it in the "head" element and you are good to go. Or yes, you can reference an external css if you want. |
Taking a better look at this issue. A shorter and simpler reproducer: <html>
<head>
<style>
p {
page-break-after: always;
}
</style>
</head>
<body>
<p>
<b>bolded text</b>
</p>
<ol>
<li>counter should not be bold</li>
</ol>
</body>
</html> The counter is currently bold, which is wrong. What I noticed is in PdfBoxFastOutputDevice.drawStringFast , the call |
Hello,
I found some weird behaviour when I generate PDF with 2 or more pages. When there's a bold word (in < strong> tags, as you can see '< strong>expedita< /strong>' in my attachment) in the last line of the page, then numeration on the next page is bold as well (it shouldn't be as there's a < /strong>)
This is my code:
There's a 'convertToXhtml' method, I attached xhtml.txt so you can review what is put into 'withHtmlContent(...)'
Have you met that problem? Any idea if I can avoid rendering pdf that way?
xhtml.txt
The text was updated successfully, but these errors were encountered: