Mohit Jagtap

Mohit Jagtap

  • NA
  • 103
  • 9.5k

How to get printing status in C#

Jan 18 2017 11:53 PM
Hi i am Mohit,
 
i have my simple function to print the document like :
 
public string PrintMyFile(string fileName)
{
     //which gets the default printer.. 
    PrintQueue printQueue = LocalPrintServer.GetDefaultPrintQueue(); 
 
    PrintSystemJobInfo printSystemJobInfo =        printQueue.AddJob(Path.GetFileNameWithoutExtension(fileName), fileName, false); 
 
  string status =  printSystemJobInfo.JobStatus;
  return status; 
 
Here in 'status' i am getting the status as 'spooling' but i need to get the status once the document is printed. How can i do that?
 I read about PrintEventArgs OnEndPrint()  but i dont know how to use it. Please guide me on this. 
 

Answers (1)