Hi,
I get wrong font name. I used following code:
public class TestFont
{
public static void main(String args[]) throws Exception
{
Document doc = new Document("d:/test/TestFont.docx");
List runs = getDocumentRuns(doc);
System.out.println(runs.get(1).getFont().getName()); // prints Times New Roman, but should be Calibri.
}
private static List getDocumentRuns(com.aspose.words.Document document) throws Exception
{
final List runList = new ArrayList();
document.accept(new DocumentVisitor()
{
@Override
public int visitRun(Run run) throws Exception
{
runList.add(run);
return super.visitRun(run);
}
});
return runList;
}
}
TestFont.docx is in attachment.
Thanks,
Zeljko