The document default style properties are not cloned on document.Clone().
There is a workaround by using the following code:
var cloning = this.document.Clone();
ClearPropertiesWithoutValueAndSetLocalValues(this.document.DefaultStyle.CharacterProperties, cloning.DefaultStyle.CharacterProperties);
ClearPropertiesWithoutValueAndSetLocalValues(this.document.DefaultStyle.ParagraphProperties, cloning.DefaultStyle.ParagraphProperties);
private void ClearPropertiesWithoutValueAndSetLocalValues(DocumentElementPropertiesBase propertiesFrom, DocumentElementPropertiesBase propertiesTo)
{
foreach (var stylePropertyFrom in propertiesFrom.StyleProperties)
{
var stylePropertyTo = propertiesTo.GetStyleProperty(stylePropertyFrom.PropertyDefinition);
stylePropertyTo.ClearValue();
if (stylePropertyFrom.HasLocalValue)
{
object value = stylePropertyTo.GetLocalValueAsObject();
stylePropertyTo.SetValueAsObject(value);
}
}
}
This item is migrated to the Telerik Document Processing portal:
http://feedback.telerik.com/Project/184/Feedback/Details/190117
Please use the new item for commenting, voting and subscribing instead of this one.