1
votes

I have a HTML file containing scripts, images and charts (uses 'svg'). As per one of the iText examples I am using following code to convert input html file into a pdf file:

HtmlConverter.convertToPdf(new FileInputStream(src), new FileOutputStream(dest));

During conversion I get following errors:

c.i.h.a.i.DefaultHtmlProcessor - No worker found for tag script

c.i.s.r.f.DefaultSvgNodeRendererFactory - Could not find implementation for tag tspan

c.i.h.c.a.u.PaddingApplierUtil - Padding value in percents not supported

How do I resolve these errors ?

Do you get a usable output? Is it at all what you want? It may be that these are really just warnings that point out some things that the converter can't deal with, either because of its own limitations, or because of problems in the HTML itself. It might be hard for anyone to help you much if you can't provide the input HTML.CryptoFool
I did get the output pdf though it is quite distorted. Tables are rendered fine. Fonts aren't because I didn't set the base path yet. I am also uploading the file here. This is a warning: 2019-03-13 10:20:44,728 [warn] c.i.s.r.f.DefaultSvgNodeRendererFactory - Could not find implementation for tag tspanNKM
[Link to HTML file] jsfiddle.net/nkmittal/3h04wjok/2NKM
I also get following error: 2019-03-13 13:05:08,533 [error] c.i.s.r.r.ResourceResolver - Unable to retrieve stream with given base URI (file:/Users/sandbox/app/) and source path (/assets/stylesheets/fonts/lineto-circular-bookitalic.woff) java.io.FileNotFoundException: /assets/stylesheets/fonts/lineto-circular-bookitalic.woff (No such file or directory) The base URI and source path (in input html is correct).NKM
Which version of iText are you using?Amedee Van Gasse