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

Free Support Forum - aspose.com

Style has wrong font

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I’m having an interesting issue with version 11.11.0.0 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:

idoc.Styles["Strong"].Font.Name

"Times New Roman"

Many thanks

Russell

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.

<span lang=“EN-GB” style=“font-size:10.0pt;font-family:“Courier New”;color:#2B91AF;mso-font-kerning:
0pt;mso-no-proof:yes”>Document<span lang=“EN-GB” style=“font-size:10.0pt;
font-family:“Courier New”;mso-font-kerning:0pt;mso-no-proof:yes”> doc = new Document(MyDir

  • “strong+Admin.docx”);<o:p></o:p>

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.
(12)