When using the Clone function from RadFlowDocument, the below exception is thrown :
[2022-10-07T13:06:32.329Z] Error: System.ArgumentException: The document element is associated with another document. (Parameter 'item')
at Telerik.Windows.Documents.Flow.Model.Collections.DocumentElementCollection`2.VerifyDocumentElementOnInsert(T item)
at Telerik.Windows.Documents.Flow.Model.Collections.DocumentElementCollection`2.AddClonedChildrenFrom(DocumentElementCollection`2 fromCollection, CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.Paragraph.CloneCore(CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.Collections.DocumentElementCollection`2.AddClonedChildrenFrom(DocumentElementCollection`2 fromCollection, CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.Footer.CloneCore(CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.HeadersFootersBase`1.CloneHeadersFootersFrom(HeadersFootersBase`1 headersFooters, CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.Section.ClonePropertiesAndHeadersFooters(CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.Section.CloneCore(CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.Collections.DocumentElementCollection`2.AddClonedChildrenFrom(DocumentElementCollection`2 fromCollection, CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.RadFlowDocument.CloneCore(CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.RadFlowDocument.Clone()
at Perspex.Shared.OOPGenerator.OOPGenerator.SetWordDocumentTemplate(Schools school, SchoolYear schoolyear) in D:\projecten\cip\Perspex\src\Perspex.Shared\OOPGenerator\OOPGenerator.cs:line 62
It occurs after I upgraded to the latest version (2022.3.906) of RAD Document processing. In the previous version it worked as expected.
Steps I take to reproduce the issue :
1) Load a word document
2) Clone the document.