Edit

Share via


PrintJobStatus Enum

Definition

Specifies the current status of a print job in a print queue.

This enumeration supports a bitwise combination of its member values.

C#
[System.Flags]
public enum PrintJobStatus
Inheritance
PrintJobStatus
Attributes

Fields

Name Value Description
None 0

The print job has no specified state.

Paused 1

The print job is paused.

Error 2

The print job is in an error state.

Deleting 4

The print job is in the process of being deleted.

Spooling 8

The print job is spooling.

Printing 16

The print job is now printing.

Offline 32

The printer is offline.

PaperOut 64

The printer is out of the required paper size.

Printed 128

The print job printed.

Deleted 256

The print job was deleted from the queue, typically after printing.

Blocked 512

An error condition, possibly on a print job that precedes this one in the queue, blocked the print job.

UserIntervention 1024

The printer requires user action to fix an error condition.

Restarted 2048

The print job was blocked but has restarted.

Completed 4096

The print job is complete, including any post-printing processing.

Retained 8192

The print job is retained in the print queue after printing.

Examples

The following example shows how to use this enumeration when diagnosing a problem with a print job.

C#
// Check for possible trouble states of a print job using the flags of the JobStatus property
internal static void SpotTroubleUsingJobAttributes(PrintSystemJobInfo theJob)
{
    if ((theJob.JobStatus & PrintJobStatus.Blocked) == PrintJobStatus.Blocked)
    {
        Console.WriteLine("The job is blocked.");
    }
    if (((theJob.JobStatus & PrintJobStatus.Completed) == PrintJobStatus.Completed)
        || 
        ((theJob.JobStatus & PrintJobStatus.Printed) == PrintJobStatus.Printed))
    {
        Console.WriteLine("The job has finished. Have user recheck all output bins and be sure the correct printer is being checked.");
    }
    if (((theJob.JobStatus & PrintJobStatus.Deleted) == PrintJobStatus.Deleted)
        || 
        ((theJob.JobStatus & PrintJobStatus.Deleting) == PrintJobStatus.Deleting))
    {
        Console.WriteLine("The user or someone with administration rights to the queue has deleted the job. It must be resubmitted.");
    }
    if ((theJob.JobStatus & PrintJobStatus.Error) == PrintJobStatus.Error)
    {
        Console.WriteLine("The job has errored.");
    }
    if ((theJob.JobStatus & PrintJobStatus.Offline) == PrintJobStatus.Offline)
    {
        Console.WriteLine("The printer is offline. Have user put it online with printer front panel.");
    }
    if ((theJob.JobStatus & PrintJobStatus.PaperOut) == PrintJobStatus.PaperOut)
    {
        Console.WriteLine("The printer is out of paper of the size required by the job. Have user add paper.");
    }

    if (((theJob.JobStatus & PrintJobStatus.Paused) == PrintJobStatus.Paused)
        || 
        ((theJob.HostingPrintQueue.QueueStatus & PrintQueueStatus.Paused) == PrintQueueStatus.Paused))
    {
        HandlePausedJob(theJob);
        //HandlePausedJob is defined in the complete example.
    }

    if ((theJob.JobStatus & PrintJobStatus.Printing) == PrintJobStatus.Printing)
    {
        Console.WriteLine("The job is printing now.");
    }
    if ((theJob.JobStatus & PrintJobStatus.Spooling) == PrintJobStatus.Spooling)
    {
        Console.WriteLine("The job is spooling now.");
    }
    if ((theJob.JobStatus & PrintJobStatus.UserIntervention) == PrintJobStatus.UserIntervention)
    {
        Console.WriteLine("The printer needs human intervention.");
    }
}//end SpotTroubleUsingJobAttributes

Remarks

This enumeration is used primarily as the value of the JobStatus property.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also