The HTMLWorker class HTMLWorker deprecated. It was launched as a personal project for analyzing small fragments of HTML. It was written without a clear design. It was to serve the purpose of an individual in one specific project.
However, he somehow got into the main release, and people began to use it for purposes for which it was not built. People complained about errors, not knowing that HTMLWorker never meant to be hard work.
Other developers began to improve HTMLWorker , but soon found HTMLWorker flawed in the erroneous design (and spaghetti code).
An XML Worker is a project that was made by developers paid by iText Group. It is used in various projects. It was not intended as a tool for URL2PDF, in the sense that it cannot convert a complex web page to PDF, but allows you to create templates using direct HTML and CSS, fill out these templates and convert them to PDF.
The XML worker suffers because iText was not originally intended to render HTML. For example: in iText 5 (and previous versions), properties such as fonts, colors, ... are not inherited. These flaws are fixed in iText 7. XML Worker has not yet been ported to iText 7, but it is next on our technical roadmap.
To summarize: you should not use HTMLWorker . It will not be supported in the future.
source share