/// <summary>
        /// Print document.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Print_Click(object sender, RoutedEventArgs e)
        {
            // Get the document.
            FlowDocument flow     = mainRTB.Document;
            double       fontSize = flow.FontSize * 2;

            // Send the rich text data to the print preview.
            IDocumentPaginatorSource document = new Nequeo.Wpf.UI.Printing.RichTextBoxDocument(mainRTB, new Size(800, 1000), new Size(1, 1), fontSize).Document;

            Nequeo.Wpf.UI.Printing.PreviewDialog dialog  = new Nequeo.Wpf.UI.Printing.PreviewDialog(document);
            Nequeo.Wpf.UI.Printing.Preview       preview = new Nequeo.Wpf.UI.Printing.Preview(dialog);
            preview.ShowDialog();
        }
示例#2
0
 /// <summary>
 /// Preview document.
 /// </summary>
 /// <param name="dialog">The print preview dialog.</param>
 public Preview(PreviewDialog dialog)
 {
     _previewDialog = dialog;
 }