Pdf Java does not convert html to pdf properly

SampleFileAndOutput.zip (23.8 KB)

Aspose Team,
We use the Aspose PDF java package to convert html to pdf, and found out that the output is in text format (not in html presentation format) for the sample file.

Following is the sample code and attached is a sample file and the output pdf.
The operating system is Ubuntu 20.04. Java version is 17. Aspose PDF java packages is 23.10.

import com.aspose.pdf.Document;
import com.aspose.pdf.HtmlLoadOptions;
import java.nio.file.Paths;

public class HtmlToPdf_26_27 {

public static void main(String[] args) throws Exception {
    try {
        new com.aspose.pdf.License().setLicense("/home/ubuntu/QmulusWorker/required/Aspose.Total.Java.lic");
        String htmlFile = "/home/ubuntu/testdirs/html_to_pdf/DmxNtvg0.html";
        String pdfFile  = "/home/ubuntu/testdirs/html_to_pdf/DmxNtvg0.html_pdf_out.pdf";
        HtmlLoadOptions options = new HtmlLoadOptions();
        Document pdfDocument = new Document(htmlFile, options);
        pdfDocument.save(Paths.get(pdfFile).toString());
    }
    catch(Exception ex) {
        ex.printStackTrace();
    }
}

@xyang

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFJAVA-43332

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.