使用 itext 将 html 转换为 pdf 期间 iText 7 异常:css 属性“text-decoration-thickness”的默认值未知
我正在使用 Itext7 使用 HtmlConverter 将 html 转换为 pdf,这是 html2pdf 依赖项。我在日志中收到以下错误。
ERROR com.itextpdf.styledxmlparser.css.resolve.CssDefaults - Default value of the css property "text-decoration-thickness" is unknown.
<dependency>
<groupId>com.itextpdf</groupId>`enter code here`
<artifactId>html2pdf</artifactId>
<version>3.0.5</version>
</dependency>
sample html:
<head></head><body>
<p style="color: rgb(0, 0, 0); font-family: "Times New Roman"; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; text-align: left; break-inside: auto; break-after: auto; break-before: avoid; line-height: normal; margin: 14pt 0pt; text-indent: 36pt; border-left-style: hidden; border-right-style: hidden;">
<span lang="en-US" style="font-family: Calibri; font-size: 11pt; text-transform: none; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none;">
sample html with text-decoration-thickness warning in html2pdf conversion
</span>
</p>
</body>
Iam using Itext7 to convert html to pdf using HtmlConverter, and here is the html2pdf dependecy. Iam getting the following error in the log.
ERROR com.itextpdf.styledxmlparser.css.resolve.CssDefaults - Default value of the css property "text-decoration-thickness" is unknown.
<dependency>
<groupId>com.itextpdf</groupId>`enter code here`
<artifactId>html2pdf</artifactId>
<version>3.0.5</version>
</dependency>
sample html:
<head></head><body>
<p style="color: rgb(0, 0, 0); font-family: "Times New Roman"; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; text-align: left; break-inside: auto; break-after: auto; break-before: avoid; line-height: normal; margin: 14pt 0pt; text-indent: 36pt; border-left-style: hidden; border-right-style: hidden;">
<span lang="en-US" style="font-family: Calibri; font-size: 11pt; text-transform: none; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none;">
sample html with text-decoration-thickness warning in html2pdf conversion
</span>
</p>
</body>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在演示实验室。如果它在演示实验室上不起作用,则不受支持。
you can try your test on the demo lab. if it does not work on the demo lab, it is not supported.