Ejemplo n.º 1
0
        private void btnPrintPreview_Click(object sender, RoutedEventArgs e)
        {
            PrintPreviewWindow previewWnd = new PrintPreviewWindow("OrderDocument.xaml", GlobalData.m_orderExample, new OrderDocumentRenderer());

            previewWnd.Owner         = this;
            previewWnd.ShowInTaskbar = false;
            previewWnd.ShowDialog();
        }
Ejemplo n.º 2
0
        private void btnPrintDirect_Click(object sender, RoutedEventArgs e)
        {
            btnPrintDirect.IsEnabled = false;
            PrintDialog  pdlg = new PrintDialog();
            FlowDocument doc  = PrintPreviewWindow.LoadDocumentAndRender("OrderDocument.xaml", GlobalData.m_orderExample, new OrderDocumentRenderer());

            Dispatcher.BeginInvoke(new DoPrintMethod(DoPrint), DispatcherPriority.ApplicationIdle, pdlg, ((IDocumentPaginatorSource)doc).DocumentPaginator);
            m_timerToEnableButton = new Timer(TestTimerCallback, null, 3000, Timeout.Infinite);
        }
Ejemplo n.º 3
0
        private void btnPrintDlg_Click(object sender, RoutedEventArgs e)
        {
            PrintDialog pdlg = new PrintDialog();

            if (pdlg.ShowDialog() == true)
            {
                FlowDocument doc = PrintPreviewWindow.LoadDocumentAndRender("OrderDocument.xaml", GlobalData.m_orderExample, new OrderDocumentRenderer());
                Dispatcher.BeginInvoke(new DoPrintMethod(DoPrint), DispatcherPriority.ApplicationIdle, pdlg, ((IDocumentPaginatorSource)doc).DocumentPaginator);
            }
        }