コード例 #1
0
ファイル: BlankPage1.xaml.cs プロジェクト: vatsal22/Notebook
        private void AddPages(object sender, AddPagesEventArgs e)
        {
            printDoc.AddPage(this.RectangleToPrint);

            // Indicate that all of the print pages have been provided
            printDoc.AddPagesComplete();
        }
コード例 #2
0
        private void PrintDic_AddPages(object sender, AddPagesEventArgs e)
        {
            Rectangle page = (Rectangle)this.FindName("MyWebViewRectangle");

            printDoc.AddPage(page);
            printDoc.AddPagesComplete();
        }
コード例 #3
0
        private void RegisterForPrinting()
        {
            PrintDocument pd = new PrintDocument();

            pd.Paginate += (a, b) =>
            {
                pd.SetPreviewPageCount(1, PreviewPageCountType.Final);
            };
            pd.AddPages += (a, b) =>
            {
                pd.AddPage(webReceipt);
                pd.AddPagesComplete();
            };
            pd.GetPreviewPage += (a, b) =>
            {
                pd.SetPreviewPage(b.PageNumber, webReceipt);
            };

            PrintManager.GetForCurrentView().PrintTaskRequested += (sender, e) => e.Request.CreatePrintTask("Účtenka RestSys", async args =>
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    args.SetSource(pd.DocumentSource);
                });
            });
        }
コード例 #4
0
ファイル: MyMainPage.xaml.cs プロジェクト: edetoc/samples
        void printDocument_AddPages(object p_sender, AddPagesEventArgs e)
        {
            if (m_printDocumentSource == null)
            {
                return;
            }
            else
            {
                if (m_pages == null || m_pages.Count == 0)
                {
                    return;
                }
            }

            //LogHelper.LogActivityComplete("IMPRESSION : Envoi des pages à l'imprimante");

            foreach (UIElement l_page in m_pages)
            {
                //LogHelper.LogActivityComplete("IMPRESSION : Ajout d'une page");
                m_printDoc.AddPage(l_page);
            }

            PrintDocument printDoc = (PrintDocument)p_sender;

            printDoc.AddPagesComplete();
        }
コード例 #5
0
        private void AddPages(object sender, AddPagesEventArgs e)
        {
            printDoc.AddPage(Orders_List);

            // Indicate that all of the print pages have been provided
            printDoc.AddPagesComplete();
        }
コード例 #6
0
        /// <summary>
        /// This is the event handler for PrintDocument.AddPages. It provides all pages to be printed, in the form of
        /// UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements
        /// into a pages that the Windows print system can deal with.
        /// </summary>
        /// <param name="sender">The print document.</param>
        /// <param name="e">Arguments containing the print task options.</param>
        protected override async void AddPrintPages(object sender, AddPagesEventArgs e)
        {
            PrintDocument printDoc = (PrintDocument)sender;

            // Loop over all of the preview pages
            for (int i = 0; i < NumberOfPhotos; i++)
            {
                UIElement page      = null;
                bool      pageReady = false;

                lock (printSync)
                {
                    pageReady = pageCollection.TryGetValue(i, out page);
                }

                if (!pageReady)
                {
                    // If the page is not ready create a task that will generate its content.
                    page = await GeneratePageAsync(i + 1, currentPageDescription);
                }

                printDoc.AddPage(page);
            }

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

            // Reset the current page description as soon as possible since the PrintTask.Completed event might fire later (long running job)
            currentPageDescription = null;
        }
コード例 #7
0
        private void AddPrintPages(object sender, AddPagesEventArgs e)
        {
            PrintDocument printDoc = (PrintDocument)sender;

            printDoc.AddPage(this.printPage);
            printDoc.AddPagesComplete();
        }
コード例 #8
0
 //添加打印页面的内容
 private void PrintDic_AddPages(object sender, AddPagesEventArgs e)
 {
     //增加一个页要打印的元素
     printDoc.AddPage(this);
     //完成对打印页面的增加
     printDoc.AddPagesComplete();
 }
コード例 #9
0
 async void OnAddPages(object sender, AddPagesEventArgs e)
 {
     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => {
         var image = await RenderPageForPrinting(AssociatedObject);
         printDocument.AddPage(image);
         printDocument.AddPagesComplete();
     });
 }
コード例 #10
0
 private void PrintDoc_AddPages(object sender, AddPagesEventArgs e)
 {
     foreach (var item in paginas)
     {
         printDoc.AddPage(item);
     }
     printDoc.AddPagesComplete();
 }
コード例 #11
0
 protected void AddPrintPages(object sender, AddPagesEventArgs e)
 {
     foreach (UIElement element in printPreviewElements)
     {
         printDocument.AddPage(element);
     }
     ((PrintDocument)sender).AddPagesComplete();
 }
コード例 #12
0
ファイル: MainPage.xaml.cs プロジェクト: GraceFeng/CPrint
 private void PrintDic_AddPages(object sender, AddPagesEventArgs e)
 {
     foreach (var item in MyPrintPages.Items)
     {
         var rect = item as Rectangle;
         printDoc.AddPage(rect);
     }
     printDoc.AddPagesComplete();
 }
コード例 #13
0
        void OnPrintDocumentAddPages(object sender, AddPagesEventArgs args)
        {
            foreach (UIElement calendarPage in calendarPages)
            {
                printDocument.AddPage(calendarPage);
            }

            printDocument.AddPagesComplete();
        }
コード例 #14
0
        /// <summary>
        /// “导出”功能添加页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PrintDocument_AddPages(object sender, AddPagesEventArgs e)
        {
            foreach (var page in pagesToPrint)
            {
                printDocument.AddPage(page);
            }

            printDocument.AddPagesComplete();
        }
コード例 #15
0
ファイル: PrinterJob.cs プロジェクト: arambazamba/moc-20487
        private void PrintDocument_AddPages(object sender, AddPagesEventArgs e)
        {
            foreach (UIElement page in _printPages)
            {
                _printDocument.AddPage(page);
            }

            // Indicate that all of the print pages have been provided
            _printDocument.AddPagesComplete();
        }
コード例 #16
0
        void OnPrintDocumentAddPages(object sender, AddPagesEventArgs args)
        {
            if (customPageRange != null && customPageRange.IsValid)
            {
                foreach (int oneBasedIndex in customPageRange.PageMapping)
                {
                    printDocument.AddPage(bookPages[oneBasedIndex - 1]);
                }
            }
            else
            {
                foreach (UIElement bookPage in bookPages)
                {
                    printDocument.AddPage(bookPage);
                }
            }

            printDocument.AddPagesComplete();
        }
コード例 #17
0
        /// <summary>
        /// 印刷情報の設定
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddPages(object sender, AddPagesEventArgs e)
        {
            foreach (UImage image in _imageList.Items)
            {
                _printDocument.AddPage(image);
            }

            // 印刷開始
            _printDocument.AddPagesComplete();
        }
コード例 #18
0
ファイル: PrintHelper.cs プロジェクト: vatsal22/Notebook
        private void AddPages(object sender, AddPagesEventArgs e)
        {
            foreach (var element in ElementsToPrint)
            {
                printDoc.AddPage(element);
            }


            // Indicate that all of the print pages have been provided
            printDoc.AddPagesComplete();
        }
コード例 #19
0
        protected virtual void AddPrintPages(object sender, AddPagesEventArgs e)
        {
            for (int i = 0; i < printPreviewPages.Count; i++)
            {
                printDocument.AddPage(printPreviewPages[i]);
            }

            PrintDocument printDoc = (PrintDocument)sender;

            printDoc.AddPagesComplete();
        }
コード例 #20
0
        void printDocument_AddPages(object sender, AddPagesEventArgs e)
        {
            for (int i = 0; i < pages.Count; i++)
            {
                document.AddPage(pages[i]);
            }

            PrintDocument printDoc = (PrintDocument)sender;

            printDoc.AddPagesComplete();
        }
コード例 #21
0
        protected virtual void AddPrintPages(object sender, AddPagesEventArgs e)
        {
            // Loop over all of the preview pages and add each one to  add each page to be printied
            for (int i = 0; i < printPreviewPages.Count; i++)
            {
                printDocument.AddPage(printPreviewPages[i]);
            }

            // Indicate that all of the print pages have been provided
            printDocument.AddPagesComplete();
        }
コード例 #22
0
        private void AddPrintPages(object sender, AddPagesEventArgs e)
        {
            // add all already prepared pages to print document
            for (int i = 0; i < printPages.Count; i++)
            {
                printDocument.AddPage(printPages[i]);
            }

            // Indicate that all of the print pages have been provided
            (sender as PrintDocument).AddPagesComplete();
        }
コード例 #23
0
        private void AddPages(object sender, AddPagesEventArgs e)
        {
            try {
                printDoc.AddPage(this);
            } catch {
                App.ShowMessage("Please restart application and try again.");
            }

            // Indicate that all of the print pages have been provided
            printDoc.AddPagesComplete();
        }
コード例 #24
0
        private void AddPages(object sender, AddPagesEventArgs e)
        {
            for (var i = 1; i < _pageCount + 1; i++)
            {
                var el = OnPrinting(i);
                printDoc.AddPage(el);
                OnPrinted(i, el);
            }

            printDoc.AddPagesComplete();
        }
コード例 #25
0
    private static void AddPrintPages(object sender, AddPagesEventArgs e)
    {
        // Loop over all of the preview pages and add each one to  add each page to be printied
        for (int i = 0; i < printPreviewPages.Count; i++)
        {
            // We should have all pages ready at this point...
            printDocument.AddPage(printPreviewPages[i].Page);
        }

        // Indicate that all of the print pages have been provided
        printDocument.AddPagesComplete();
    }
コード例 #26
0
        /// <summary>
        /// This is the event handler for PrintDocument.AddPages. It provides all pages to be printed, in the form of
        /// UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements
        /// into a pages that the Windows print system can deal with.
        /// </summary>
        /// <param name="sender">PrintDocument</param>
        /// <param name="e">Add page event arguments containing a print task options reference.</param>
        protected virtual void OnAddPrintPages(object sender, AddPagesEventArgs e)
        {
            // Loop over all of the preview pages and add each one to  add each page to be printed.
            for (int i = 0; i < PrintPreviewPages.Count; i++)
            {
                // We should have all pages ready at this point.
                PrintDocument.AddPage(PrintPreviewPages[i]);
            }

            // Indicate that all of the print pages have been provided.
            (sender as PrintDocument).AddPagesComplete();
        }
コード例 #27
0
ファイル: MainPage.xaml.cs プロジェクト: Ivarad/Portfolio
        private void AddPages(object sender, AddPagesEventArgs e)
        {
            string textStr = "";

            flextextwrite.Document.GetText(TextGetOptions.FormatRtf, out textStr);
            RichEditBox richTextBlock = new RichEditBox();

            richTextBlock.Document.SetText(TextSetOptions.FormatRtf, textStr);
            richTextBlock.Background = new SolidColorBrush(Windows.UI.Colors.White);
            richTextBlock.Padding    = new Thickness(20, 20, 20, 20);
            printDoc.AddPage(richTextBlock);
        }
コード例 #28
0
        private async void AddPages(object sender, AddPagesEventArgs e)
        {
            for (int i = min; i <= max; i++)
            {
                await CreateQR(i);

                printDoc.AddPage(this.RectangleToPrint);
            }

            // Indicate that all of the print pages have been provided
            printDoc.AddPagesComplete();
        }
コード例 #29
0
        /// <summary>
        /// This is the event handler for PrintDocument.AddPages. It provides all pages to be printed, in the form of
        /// UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements
        /// into a pages that the Windows print system can deal with.
        /// </summary>
        /// <param name="sender">PrintDocument</param>
        /// <param name="e">Add page event arguments containing a print task options reference</param>
        private void AddPrintPages(object sender, AddPagesEventArgs e)
        {
            // Loop over all of the pages and add each one to be printed
            foreach (FrameworkElement page in pages)
            {
                printDocument.AddPage(page);
            }
            PrintDocument printDoc = (PrintDocument)sender;

            // Indicate that all of the print pages have been provided
            printDoc.AddPagesComplete();
        }
コード例 #30
0
        /// <summary>
        /// This is the event handler for PrintDocument.AddPages. It provides all pages to be printed, in the form of
        /// UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements
        /// into a pages that the Windows print system can deal with.
        /// </summary>
        /// <param name="sender">PrintDocument</param>
        /// <param name="e">Add page event arguments containing a print task options reference</param>
        protected virtual void AddPrintPages(object sender, AddPagesEventArgs e)    // Required
        {
            // Loop over all of the preview pages and add each one to  add each page to be printed
            for (int i = 0; i < _printPreviewPages.Count; i++)
            {
                // We should have all pages ready at this point...
                _printDocument.AddPage(_printPreviewPages[i]);
            }

            PrintDocument printDoc = (PrintDocument)sender;

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