Hello,
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();
options.setLoadFormat(LoadFormat.HTML);
options.setPreserveIncludePictureField(true);
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 =
com.aspose.words.SaveOptions.createSaveOptions(SaveFormat.RTF);
saveOptions.setSaveFormat(SaveFormat.RTF);
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)
Thanks