Issue
I'm trying to create a pdf file using iText in Java. My HTML consists of CSS bootsrap version v4.3.1
. During the conversion, I'm getting an error like this ERROR c.i.s.c.p.s.CssParserStateController - The rule @-webkit-keyframes is unsupported. All selectors in this rule will be ignored.
I'm trying with Java HTML to pdf conversion using iText 7.1.9
maven dependency. How can I avoid these errors or include this CSS tag?. Since it is loading from the bootstrap I can't change that.
My Code:
ConverterProperties props = new ConverterProperties();
props.setMediaDeviceDescription(new MediaDeviceDescription(MediaType.PRINT));
props.setCssApplierFactory(new DefaultCssApplierFactory());
HtmlConverter.convertToPdf("input.html", new FileOutputStream("output.pdf"), props);
Solution
I couldn't find any perfect solution to the above, but I updated my HTML by removing unwanted resources, and that works for me.
Answered By - Sonu