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
Zeljko