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

2 posts, 0 answers
  1. N
    N avatar
    21 posts
    Member since:
    May 2012

    Posted 17 May 2012 Link to this post

    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.

  2. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 21 May 2012 Link to this post

    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 >>

Back to Top