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

Free Support Forum - aspose.com

Font name and size

Hi,

I have a problem getting the correct font name from the document I have attached. Instead of "Calibri" I keep getting
"Book Antiqua". Also, for the text I have highlighted in the screenshot I get the wrong font size. Instead of 11 I got 8. Can you check this out?
The code that reproduces this issue:

public void test() throws Exception {
Document document = new Document("Test.docx");

List runs = getRuns(document);
for(Run run: runs) {
System.out.println(run.getFont().getName());
System.out.println(run.getFont().getSize());
}
}

private List getRuns(Document document) throws Exception {
final List runs = new ArrayList();

document.accept(new DocumentVisitor() {

@Override
public int visitRun(Run run) throws Exception {
runs.add(run);

return super.visitRun(run);
}

});

return runs;
}



Thanks,
Zeljko

Hi Zeljko,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-12732. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.