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

Printing RadRichText after merging RadDocuments.. Print method hangs on and does not print.

1 Answer 46 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
N
Top achievements
Rank 1
N asked on 17 May 2012, 06:07 PM

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.

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 21 May 2012, 05:02 PM
Hi,

Please refer to this forum thread for the answer to your question.

Regards,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
General Discussions
Asked by
N
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or