Hello,
I am trying to copy docDefaults from one document to anonther. Is there a way to do this with aspose.
I am using the following code to copy styles from one document to another (doc is my target Document and styleDoc is my source):
StyleCollection target = doc.getStyles();
StyleCollection source = styleDoc.getStyles();
for (int i = 0; i < source.getCount(); i++) {
Style sourceStyle = source.get(i);
Style targetStyle = target.addCopy(sourceStyle);
targetStyle.setName(sourceStyle.getName());
}
Hower I also need to copy docDefaults.
The style.xml that im am using as my source to copy styles from contains:
<w:docDefaults>
<w:rPrDefault>
<w:rPr>
<w:rFonts w:ascii="Bookman Old Style" w:eastAsiaTheme="minorHAnsi"
w:hAnsi="Bookman Old Style" w:cstheme="minorBidi"/>
<w:sz w:val="40"/>
<w:szCs w:val="40"/>
<w:lang w:val="en-NL" w:eastAsia="en-US" w:bidi="ar-SA"/>
</w:rPr>
</w:rPrDefault>
<w:pPrDefault>
<w:pPr>
<w:spacing w:after="160" w:line="259" w:lineRule="auto"/>
</w:pPr>
</w:pPrDefault>
</w:docDefaults>
And I would like to copy this to the style.xml of my targetDocument.
Regards,
Herman