Thanks for your request. I managed to reproduce the problem on my side. You will be notified as soon as it is resolved.
As a workaround you can specify LocaleId explicitly in your code.
Document doc = new Document("in.htm");
Node[] nodes = doc.GetChildNodes(NodeType.Run, true).ToArray();
// Loop throught all runs
foreach(Run node in nodes)
{
// Set English UK locale
// For the list of locale identifiers see http://www.microsoft.com/globaldev/reference/lcid-all.mspx
node.Font.LocaleId = 2057;
}
doc.Save("out.rtf");
thanks for the response. I have successfully implemented this solution for the “Run” type of nodes, however, the Shape type (images) for the document are still being shown as having a default language of Russian! Is there any way round this?
Thanks for your request. In this case, it is better to use DocumentVisitor to achieve this. Please follow the link to learn more about DocuemntVisitor:
Hi, thanks for the reply. I’ve decided to read in the html as a stream and then use insertHTML with the document builder which works beutifully as follows:
StreamReader sr = new StreamReader(Server.MapPath("htmltest.htm"));
string htmlString = sr.ReadToEnd();
sr.Close();
Document doc = new Document();
DocumentBuilder db = new DocumentBuilder(doc);
db.Font.LocaleId = 2057;
db.InsertHtml(htmlString);
However, within the html, I have surrounding some of the text, but the font-size is always 12pt in the word document. When I change the to a , the font size shows up as 22pt in word.
Am I correct in thinking that are not supported by Aspose and if so will it ever be supported?
Hi
Thanks for your request. The problem occurs because, currently, Aspose.Words does not support inheriting styles from parent elements.
Currently, Aspose.Words expects that font formatting is set in <span>, <i>, <b> or <u> element, formatting of paragraph – in <p> or <h1>…<h6> elements etc…
I linked your request to the appropriate issue, you will be notified as soon as it is resolved.
Best regards,