Incorrect rendering when converting HTML to PDF with Aspose HTML Java (black background)

Hello,

We have found a weird issue. One of our customers reported a problem when an email converted to HTML could not be properly converted to a PDF. The issue was that part of the text was rendered with a black background (like it would be redacted). We were able to re-create a minimal HTML sample where the issue is reproducible. It looks like this (Original HTML and rendered PDF):

image.png (55.6 KB)

The weird part is that if you remove the first “div” element that contains “From”, it starts rendering the text fine. That is clearly some issue with processing the styles. The HTML was probably generated by MS Word, but we are not sure.

We are using Java 21.0.7 64-bit on Windows 11. Aspose HTML 26.5.

Sample HTML and produced PDF:

AsposeHtmlToPdfBug.7z (20.2 KB)

Code to reproduce:

import com.aspose.html.HTMLDocument;
import com.aspose.html.converters.Converter;
import com.aspose.html.saving.PdfSaveOptions;

public class AsposeHtmlToPdfBug {

	public static void main(String[] args) {
		String html = "sample.html";
		String pdf = "sample.html.pdf";
		Converter.convertHTML(new HTMLDocument(html), new PdfSaveOptions(), pdf);
	}

}