Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,686 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When I print a document, I have no paper, this time, I want to get finished or paperless status? Thanks
You can use the below code which use PrintQueue to get the status PrintQueueStatus of printer:
public static void GetPrintStatus()
{
PrintQueue pq = LocalPrintServer.GetDefaultPrintQueue();
switch (pq.QueueStatus)
{
case PrintQueueStatus.None:
Console.WriteLine("Status is not specified");
break;
case PrintQueueStatus.OutputBinFull:
Console.WriteLine("The printer's output bin is full");
break;
case PrintQueueStatus.PaperOut:
Console.WriteLine("The printer does not have, or is out of, the type of paper needed for the current print job");
break;
case PrintQueueStatus.Printing:
Console.WriteLine("Printer is printing");
break;
default:
Console.WriteLine(pq.QueueStatus);
break;
}
}