key: WPF, RadRichTextBox, RadDocument
I did the following steps to print merged RadDocument but it does not print and calling Print method hangs on forever. I had to kill the process. Printing 1 Document works fine but same issue happens when I try to print 2 merged documents.
1. I am merging a list of RadDocuments in to one RadDocument using methods answered in this forum.
2. Then setting RadRichTextBox’s document to the above created merged RadDocument.
3. Then printing using RadRichTextBox’s print method. radRichTextBox.Print("richtextbox", PrintMode.Native)
FYI, for Part 1) I did try this:
foreach(var document in radDocuments)
{
mergedDocument.CaretPosition.MoveToLastPositionInDocument();
mergedDocument.InsertInline(new Telerik.Windows.Documents.Model.Span(FormattingSymbolLayoutBox.PAGE_BREAK));
mergedDocument.InsertFragment(new DocumentFragment(document));
}
and also this:
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);
}
}
Am i merging RadDocuments correctly? What could be the issue?
If this is a known Issue, then whats the best way to Merge and Print RadDocuments?
By the way : Document 1 had 7 pages and Document had 4 pages with 4 images total. It seems that as soon as I merge it does not print.
Thanks