Hi
Thanks for your inquiry. Why do you use UTF32 encoding to read the file? You should use UTF8, in this case both output documents looks the same.
String html = "Large text: <font size=\"5\">Text</font>.";
LoadOptions loadOptions;
Document document;
using (StreamWriter wrt = new StreamWriter(@"C:\temp\tmpdata.html"))
wrt.Write(html);
loadOptions = new LoadOptions();
loadOptions.LoadFormat = LoadFormat.Html;
document = new Document(@"C:\temp\tmpdata.html", loadOptions);
document.Save(@"C:\temp\format_ok.docx");
using (Stream s = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(html)))
{
loadOptions = new LoadOptions();
loadOptions.LoadFormat = LoadFormat.Html;
document = new Document(s, loadOptions);
document.Save(@"C:\temp\format_not_ok.docx");
}
Best regards,
Best regards,
Alexey Noskov
Developer/Technical Support
Aspose Auckland Team