Hi support,
Please check the following code :
Document doc = new Document("c:\TemplExample.dot");
Body body = doc.getSections().get(0).getBody();
if ((body != null) && (body.getChildNodes() != null))
{
Node[] nodes = body.getChildNodes().toArray();
for (Node node: nodes)
{
if (node.isComposite())
{
CompositeNode compositeNode = (CompositeNode) node;
if (compositeNode != null)
{
Node[] childNodes = compositeNode.getChildNodes().toArray();
for (Node node1: childNodes)
{
Run run = (Run) node1;
if (run != null)
{
System.out.println(run.getText());
}
System.out.println("original font name = " + run.getFont().getName());
Run runClone = (Run) run.deepClone(true);
System.out.println("clone font name = " + runClone.getFont().getName());
}
}
}
}
}
Note that the font name is not preserved in the clone.
The template is made in Word 2007. If I make the same thing with Word 2003, everything is as expected.
If the font size is 11 in the template, the clone shall have the size equal with 10.
Please advice,
Milan