CSS iText pdf 转换中不支持的关键问题
CSS unsupported key issue in iText pdf conversion
我正在尝试在 Java 中使用 iText 创建一个 pdf 文件。我的 HTML 包含 CSS bootsrap 版本 v4.3.1
。在转换过程中,我收到这样的错误 ERROR c.i.s.c.p.s.CssParserStateController - The rule @-webkit-keyframes is unsupported. All selectors in this rule will be ignored.
我正在尝试使用 iText 7.1.9
maven 依赖项将 Java HTML 转换为 pdf。我怎样才能避免这些错误或包含这个 CSS 标签?。因为它是从 bootstrap 加载的,所以我无法更改它。
我的代码:
ConverterProperties props = new ConverterProperties();
props.setMediaDeviceDescription(new MediaDeviceDescription(MediaType.PRINT));
props.setCssApplierFactory(new DefaultCssApplierFactory());
HtmlConverter.convertToPdf("input.html", new FileOutputStream("output.pdf"), props);
我找不到任何完美的解决方案,但我通过删除不需要的资源更新了我的 HTML,这对我有用。
我正在尝试在 Java 中使用 iText 创建一个 pdf 文件。我的 HTML 包含 CSS bootsrap 版本 v4.3.1
。在转换过程中,我收到这样的错误 ERROR c.i.s.c.p.s.CssParserStateController - The rule @-webkit-keyframes is unsupported. All selectors in this rule will be ignored.
我正在尝试使用 iText 7.1.9
maven 依赖项将 Java HTML 转换为 pdf。我怎样才能避免这些错误或包含这个 CSS 标签?。因为它是从 bootstrap 加载的,所以我无法更改它。
我的代码:
ConverterProperties props = new ConverterProperties();
props.setMediaDeviceDescription(new MediaDeviceDescription(MediaType.PRINT));
props.setCssApplierFactory(new DefaultCssApplierFactory());
HtmlConverter.convertToPdf("input.html", new FileOutputStream("output.pdf"), props);
我找不到任何完美的解决方案,但我通过删除不需要的资源更新了我的 HTML,这对我有用。