使用 itext 将 html 转换为 pdf 期间 iText 7 异常:css 属性“text-decoration-thickness”的默认值未知

发布于 2025-01-09 07:01:43 字数 1415 浏览 1 评论 0原文

我正在使用 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: &quot;Times New Roman&quot;; 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

素手挽清风 2025-01-16 07:01:43

you can try your test on the demo lab. if it does not work on the demo lab, it is not supported.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文