Hi,
I have Word 97-2003 document with hyperlinks, and as You can see from attached screenshot it is not bolded. When I use following code:
private class MyDocumentVisitor extends DocumentVisitor {
private int _runCounter = 0;
@Override
public int visitRun(Run run) throws Exception {
incrementRunCounter();
if (getRunCounter() == 7) {
System.out.println("RUN TEXT: " + run.getText());
System.out.println("RUN IS BOLD: " + run.getFont().getBold());
}
return super.visitRun(run);
}
private int getRunCounter() {
return _runCounter;
}
private void incrementRunCounter() {
_runCounter++;
}
}
public void test() throws Exception {
String filePath = “hyperlink.doc”;
Document doc = new Document(filePath);
doc.accept(new MyDocumentVisitor());
}
I am getting following output:
RUN TEXT: www.mpic.gov.lv
RUN IS BOLD: true
Mentioned Word file is attached to this post too. Can You help me here?
Best regards,
Zeljko