We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.words java is adding times new roman as default font while conversion

when i use this following code to convert html text to rtf text the style in the html text is changing to times new roman as default. Can you please let me know how to fix this issue? Im using the latest aspose.words version aspose-words-19.4-jdk17.jar.

            HtmlLoadOptions options = new HtmlLoadOptions();
	ByteArrayInputStream is = new  ByteArrayInputStream(htmlString.getBytes(Charset.forName("UTF-8")));
	Document doc = new Document(is, options);
	 ByteArrayOutputStream os = new ByteArrayOutputStream();
	 com.aspose.words.SaveOptions saveOptions = 
	doc.save(os, saveOptions);
	rtfString = new String(os.toByteArray(), StandardCharsets.UTF_8);

We are using java 7, 32-bit version and windows 10 Operating system. Please find the attachment of sample html text.htmltext.zip (330 Bytes)



We have test the scenario and have not found the shared issue. Please check the attached output document. output.zip (1.2 KB)

Please make sure that the fonts Impact, Charcoal, or sans-serif are installed on the system where you are converting HTML to RTF.