0
votes

I have a RichEditBox control that I would like to print. However, I can’t find a way to have content that overflows get put on a new page. (In the case of a multiple page document) How can I do this? all help is appreciated.

private void AddPages(object sender, AddPagesEventArgs e)
{
    string text;
    richEdit.GetText(TextGetOptions.FormatRTF, text);
    RichEditBox richTextBlock = new RichEditBox();
    richTextBlock.Document.SetText(TextSetOptions.FormatRtf, text);
    richTextBlock.Background = new SolidColorBrush(Windows.UI.Colors.White);
    richTextBlock.Padding = new Thickness(20,20,20,20);
    printDoc.AddPage(richTextBlock);

    // Indicate that all of the print pages have been provided
    printDoc.AddPagesComplete();
}
1

1 Answers

0
votes

You need to create multiple PrintPages for your content, then put these PrintPages to the PrintingRoot and a list of PrintPages.

You could check Fay's answer here for the complete sample : How to print on multiple pages in UWP.