Lire en anglais

Partager via


PrintJobStatus Énumération

Définition

Spécifie l'état actuel d'un travail d'impression dans une file d'attente à l'impression.

Cette énumération prend en charge une combinaison au niveau du bit de ses valeurs membres.

C#
[System.Flags]
public enum PrintJobStatus
Héritage
PrintJobStatus
Attributs

Champs

Nom Valeur Description
Blocked 512

Une condition d'erreur, éventuellement sur un travail d'impression qui précède celui‑ci dans la file d'attente, a bloqué le travail d'impression.

Completed 4096

Le travail d'impression est terminé, y compris tout traitement de post‑impression.

Deleted 256

Le travail d'impression a été supprimé de la file d'attente, en général après l'impression.

Deleting 4

Le travail d'impression est en cours de suppression.

Error 2

Le travail d'impression est dans un état d'erreur.

None 0

Le travail d'impression n'a aucun état spécifié.

Offline 32

L'imprimante est hors connexion.

PaperOut 64

L'imprimante est hors du format de papier requis.

Paused 1

Le travail d'impression est suspendu.

Printed 128

Le travail d'impression est imprimé.

Printing 16

Le travail d'impression est actuellement en cours d'impression.

Restarted 2048

Le travail d'impression a été bloqué mais a redémarré.

Retained 8192

Le travail d'impression est conservé dans la file d'attente à l'impression après l'impression.

Spooling 8

Le travail d'impression est mis en attente.

UserIntervention 1024

L'imprimante requiert une action de l'utilisateur pour résoudre une condition d'erreur.

Exemples

L’exemple suivant montre comment utiliser cette énumération lors du diagnostic d’un problème avec un travail d’impression.

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

Remarques

Cette énumération est utilisée principalement comme valeur de la JobStatus propriété .

S’applique à

Produit 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

Voir aussi