Underline formatting is lost after HTML to DOCX conversion using Java

Hi,

I am facing a problem with underlines in HTML to word conversion via ASPOSE word java api.
Please find my input file “cover.txt” as html input (I need to change the file extension as “.txt” to upload here) and my output file "cover.docx"

code used for this conversion is as follows~

File file = new File(“D:\cover.html”);
InputStream is = new FileInputStream(file);

LoadOptions loadOptions = new LoadOptions();
loadOptions.setLoadFormat(LoadFormat.HTML);

Document convDoc = new Document(is, loadOptions);
convDoc.save(“D:\cover.docx”, SaveFormat.DOCX);

As you can observe in “cover.docx” there is a black square appears, which should be a actually a small line (which is different from the lines on top of the document).
How can I get ride of this problem, please help ?


Thanks in advance.

Hi Carlton,

Thanks for your query. I have worked with you shared document and like to share with you that this is not an issue. Please see the font size in SPAN tag, it is 12pt. If you increase or decrease the font size the black square’s (Paragraph) height increase and decrease accordingly. Please see the attachment, the font size 12 has imported in Docx for paragraph.

Hope this answers your query. Please let us know, If you have any more queries.