locked
[C# WinForm System.Drawing.Printing namespace] How to know printing progress and terminate the printing job? RRS feed

  • Question

  • I am writing a simple receipt printing system using the components in System.Drawing.Printing namespace.
    But I don't know how to do as following:
    [1]How to know printing progress and show it to the user?
    [2]How to terminate printing job?Let's say the printer is printing the 100th page,but I want to terminate remaining pages printing.

    Thanks in advance!!
    Saturday, October 5, 2013 3:28 AM

Answers

  • 1 depends on what kind of progress. you can paginate your printing and report YOUR drawing progress during your drawing (e.g. handle PrintDocument.OnPrintPage), if the job is already sent to the printer, you can call GetJob to get the number of pages printed.

    2 You can abort the drawing PrintDocument.OnPrintPage. If the job is already sent to the printer, you can call SetJob to delete the printing job.



    Visual C++ MVP

    Saturday, October 5, 2013 3:49 AM