How to check that the printing job is completed?

2 posts, 0 answers
  1. Nisarg
    Nisarg avatar
    25 posts
    Member since:
    Dec 2011

    Posted 02 Dec 2015 Link to this post


     We are using  RichTextBox control for Mail merge functionality to implement in our system. Our requirement is to complete the mail merge and print the entire document.

    When the print is completed, we would like to know that the printing job is completed successfully for all pages to perform some insert/update operations in the database. We are using the following code to check the printing job is success, but we are not getting the PrintJobInfoCollection results.

     RadDocument _MergedDocument = this.radRichTextBox.MailMerge();
                    if (_MergedDocument != null)
                        this.radRichTextBox.Document = _MergedDocument;

                        PrintSettings _PrintSettings = new PrintSettings()
                            DocumentName = "My document",
                            PrintMode = PrintMode.Native,
                            PrintScaling = PrintScaling.None                        

                        PrintDialog _PrintDialog = new PrintDialog();
                        _PrintDialog.PageRangeSelection = PageRangeSelection.AllPages;
                        _PrintDialog.UserPageRangeEnabled = true;
                        Nullable<Boolean> print = _PrintDialog.ShowDialog();
                        if (print == true)
                            this.radRichTextBox.Print(_PrintDialog, _PrintSettings);                        
                            PrintJobInfoCollection jobs = _PrintDialog.PrintQueue.GetPrintJobInfoCollection();
                            foreach (PrintSystemJobInfo theJob in jobs)
                                if (((theJob.JobStatus & PrintJobStatus.Completed) == PrintJobStatus.Completed) || ((theJob.JobStatus & PrintJobStatus.Printed) == PrintJobStatus.Printed))





  2. Tanya
    Tanya avatar
    763 posts

    Posted 04 Dec 2015 Link to this post

    Hello Nisarg,

    I could suggest you to subscribe to the PrintCompleted event of RadRichTextBox, which is executed when a document is printed. With this approach you could easily notify the user that the printing has completed and they could continue working with the document.

    Hope this helps.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top