This is a migrated thread and some comments may be shown as answers.

List problems when merging multiple RadDocuments together

2 Answers 120 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 27 Jun 2018, 08:07 PM

Hello,

I have a situation where I will have a collection of multiple RadDocuments that I would like to merge together into one document (and eventually create a PDF). I am able to accomplish this, but any lists that may be contained in those documents do not come out properly. Is there something I have to do other than using CreateDeepCopy to retain those liststyles? My code is doing something like this:

    Dim mergedDocument As Telerik.Windows.Documents.Model.RadDocument = New Telerik.Windows.Documents.Model.RadDocument()

                For Each section As Section In document.Sections             

                    Dim copySection As Section = TryCast(section.CreateDeepCopy(), Section)
                    copySection.PageMargin = section.PageMargin
                    copySection.PageSize = section.PageSize
                    copySection.CopyPropertiesFrom(section)

                    mergedDocument.Sections.Add(copySection)
                Next

            Return mergedDocument

2 Answers, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 28 Jun 2018, 06:29 AM
Hello Tom,

Could you try to use RadDocumentMerger and its AppendDocument method? It additionally handles the merging of the styles in the source and target documents. If this doesn't help, could you send us the documents you are trying to merge (you can open a support ticket if you want to send them in private), and explain the difference between the expected and the actual result?

Regards,
Boby
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Tom
Top achievements
Rank 1
answered on 28 Jun 2018, 08:53 PM
Thank you, RadDocumentMerger was the way to go here. It worked perfectly. The only thing I had to do was copy over some of the section page sizing properties from my original documents to the corresponding sections in the new merged document.
Tags
RichTextBox
Asked by
Tom
Top achievements
Rank 1
Answers by
Boby
Telerik team
Tom
Top achievements
Rank 1
Share this question
or