Hi @Pat Hanks , Welcome to Microsoft Q&A,
For the more convenient and easy-to-use methods, I recommend you to use the .Net Framework platform, which is more stable for Windows development.
Generally, you can use PrintQueue in System.Printing to query the status you need.
However, if your printer is not the default printer, you will need to load that printer's queue instead. What you need to do is not call, you need to load the correct queue by calling.
using System.Printing;
class Program
{
static void Main()
{
LocalPrintServer server = new LocalPrintServer();
PrintQueue queue = server.DefaultPrintQueue;
// Get printer properties
var isOffline = queue.IsOffline;
var isPaperJammed = queue.IsPaperJammed;
var needUserIntervention = queue.NeedUserIntervention;
var hasPaperProblem = queue.HasPaperProblem;
var isBusy = queue.IsBusy;
// Some example checks for printer status
if(isOffline)
{
Console.WriteLine("Printer is offline.");
}
if (isPaperJammed)
{
Console.WriteLine("Paper jam detected.");
}
if (needUserIntervention)
{
Console.WriteLine("User intervention is required.");
}
if(hasPaperProblem)
{
Console.WriteLine("Paper problem detected.");
}
if(isBusy)
{
Console.WriteLine("Printer is busy.");
}
}
}
A more complex method is to use com to poll the target device you are connected to and query its status.
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.