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

Merging documents but keeping separate formatting/headers

1 Answer 73 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 08 Jan 2014, 10:39 PM
Hello,

I am having a problem with merging documents together and was hoping there would be a solution to this. Currently We are combining RadDocuments together with the following code found on another thread.

private RadDocument MergeDocuments(RadDocument[] documents)
{
    RadDocument mergedDocument = new RadDocument();
   
    foreach (RadDocument document in documents)
    {
        foreach (Section section in document.Sections)
        {
            Section copySection = section.CreateDeepCopy() as Section;
            document.Sections.Remove(section);
            mergedDocument.Sections.Add(copySection);
        }
    }
   
    return mergedDocument;
}

This does combine the documents but it messes with the formatting of them. Documents seem to inherit the header/footer properties of the other document and will also change the spacing and FontFamily of the document. I thought that this had something to do with the default values for a new RadDocument but I can't seem to figure out how to preserve each individual documents formatting when combining them.

I basically would like to append a document to another one and keep them looking the same as they used to just on another page (Their own headers/footers, spacing, font etc). If there is a way to do this I would appreciate any help on how to accomplish this.

Thanks,
Aaron

1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 09 Jan 2014, 03:44 PM
Hi Aaron,

Thank you for contacting us!

The RadRichTextBox’s functionality to merge documents is one of its key features. A lot of our customers insisted on having such as yours desired scenario because it’s very practical to user’s point of view. That’s why we created a sample SDK project which demonstrates how multiple documents can be merged into one.

Please take a look at this demo for a reference!

If you have any further questions, do not hesitate to contact us. 

Kind regards, Yancho
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
RichTextBox
Asked by
Aaron
Top achievements
Rank 1
Answers by
Missing User
Share this question
or