Style has wrong font

I’m having an interesting issue with version of Aspose. When I load the attached document into Aspose I get the wrong Font for the style. I am expecting using Word Style Gallery “Cambria (Headings) 14” and I’m getting “Times New Roman 14”. I’ve attached the input document and below is the output from the Immediate Window:


“Times New Roman”
Many thanks

Hi Russell,

Thanks for your inquiry. The information about fonts you would like to get is defined in MS Word themes. When font is specified via theme MS Word shows Theme’s name in round brackets (for example “Cambria (Headings)”). Unfortunately, Aspose.Words does not provide an ability to get themes information. However, we had already logged this feature request as WORDSNET-3312 in our issue tracking system. You will be notified via this forum thread once this feature is available. We apologize for your inconvenience.
Since DOC format does not support MS Word 2007 Themes, formatting specified in themes is converting to direct formatting. So as a workaround, you can save your DOCX document as DOC then open DOC file and then get font from this document as shown in following code snippet.

Document doc = new Document(MyDir + "strong+Admin.docx");

MemoryStream stream = new MemoryStream();
doc.Save(stream, SaveFormat.Doc);
Document doc2 = new Document(stream);
String fontname = doc2.Styles["Strong"].Font.Name;

The issues you have found earlier (filed as WORDSNET-3312) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.