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.
1. Line Height is not converted properly. for example, if we set the line height is 1.5 in angular UI editor, in PDF is not shown properly,
2. Table alignment is not proper - After resizing the in the angular editor, the same alignment is not converted in PDF. I think colgroup and cols custom tags are not considering while converting the PDF.
Building Document Processing source code produces assemblies with the wrong VersionReleaseNumber. This leads to version 2022.1.<version_date> instead of 2022.2.<version_date>.
Workaround: Update VersionReleaseNumber to equal 2 in "...\Telerik_UI_For_WinForms_2022_2_510_DPL_source\DPL\Build\Imports\CommonConfig.targets"
Having issues when setting form text field that is rotated. The flatten method does not respect the alignment Middle/Right.
Also the field border does not get rotated.
See attached example.
public string AppendPdfList(string[] append)
{
PdfFormatProvider provider = new PdfFormatProvider();
RadFixedDocument targetDocument = new RadFixedDocument();
provider.ImportSettings.DocumentUnhandledException += (o, args) => { args.Handled = true; };
// Iterate through the files you would like to merge
foreach (string documentName in append)
{
RadFixedDocument sourceDocument = provider.Import(File.ReadAllBytes(documentName));
targetDocument.Merge(sourceDocument);
}
TelerikPdfHelper.ClearDuplicatedFonts(targetDocument);
OutputFilename = Path.GetTempFileName();
File.WriteAllBytes(OutputFilename, provider.Export(targetDocument));
return OutputFilename;
}
Results in System.NotImplementedException: 'The method or operation is not implemented.