PrintQueue PrintQueue PrintQueue PrintQueue Class

Definition

Manages printers and print jobs.

public ref class PrintQueue : System::Printing::PrintSystemObject
public class PrintQueue : System.Printing.PrintSystemObject
type PrintQueue = class
    inherit PrintSystemObject
Public Class PrintQueue
Inherits PrintSystemObject
Inheritance

Remarks

Some properties of the PrintQueue object represent characteristics of the print queue utility that runs on the computer, but others represent features or states of the printer itself. For example, NumberOfJobs is a characteristic of the print queue, but Location is a property of the printer. Many of the properties of the printer, such as whether it needs user attention, need to be passed, by means of the Refresh method, from the printer itself to the PrintQueue object. This should be done before the corresponding property (NeedUserIntervention) is read by your program. Similarly, when your program changes the values of one or more properties of a PrintQueue object, the change must be written to the actual print queue utility on the computer. Do this with the Commit method.

Caution

Classes within the System.Printing namespace are not supported for use within a Windows service or ASP.NET application or service. Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions.

If you want to print from a Windows Forms application, see the System.Drawing.Printing namespace.

Constructors

PrintQueue(PrintServer, String) PrintQueue(PrintServer, String) PrintQueue(PrintServer, String) PrintQueue(PrintServer, String)

Initializes a new instance of PrintQueue class using the specified PrintServer and queue name.

PrintQueue(PrintServer, String, Int32) PrintQueue(PrintServer, String, Int32) PrintQueue(PrintServer, String, Int32) PrintQueue(PrintServer, String, Int32)

Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, and print schema version.

PrintQueue(PrintServer, String, Int32, PrintSystemDesiredAccess) PrintQueue(PrintServer, String, Int32, PrintSystemDesiredAccess) PrintQueue(PrintServer, String, Int32, PrintSystemDesiredAccess) PrintQueue(PrintServer, String, Int32, PrintSystemDesiredAccess)

Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, print schema version, and desired access.

PrintQueue(PrintServer, String, PrintQueueIndexedProperty[]) PrintQueue(PrintServer, String, PrintQueueIndexedProperty[]) PrintQueue(PrintServer, String, PrintQueueIndexedProperty[]) PrintQueue(PrintServer, String, PrintQueueIndexedProperty[])

Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, and array of PrintQueueIndexedProperty values to initialize.

PrintQueue(PrintServer, String, PrintQueueIndexedProperty[], PrintSystemDesiredAccess) PrintQueue(PrintServer, String, PrintQueueIndexedProperty[], PrintSystemDesiredAccess) PrintQueue(PrintServer, String, PrintQueueIndexedProperty[], PrintSystemDesiredAccess) PrintQueue(PrintServer, String, PrintQueueIndexedProperty[], PrintSystemDesiredAccess)

Initializes a new instance of PrintQueue class with the specified PrintServer, queue name, array of PrintQueueIndexedProperty values to initialize, and desired access.

PrintQueue(PrintServer, String, PrintSystemDesiredAccess) PrintQueue(PrintServer, String, PrintSystemDesiredAccess) PrintQueue(PrintServer, String, PrintSystemDesiredAccess) PrintQueue(PrintServer, String, PrintSystemDesiredAccess)

Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, and desired access.

PrintQueue(PrintServer, String, String[]) PrintQueue(PrintServer, String, String[]) PrintQueue(PrintServer, String, String[]) PrintQueue(PrintServer, String, String[])

Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, and array of property names to initialize.

PrintQueue(PrintServer, String, String[], PrintSystemDesiredAccess) PrintQueue(PrintServer, String, String[], PrintSystemDesiredAccess) PrintQueue(PrintServer, String, String[], PrintSystemDesiredAccess) PrintQueue(PrintServer, String, String[], PrintSystemDesiredAccess)

Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, property filter, and desired access.

Properties

AveragePagesPerMinute AveragePagesPerMinute AveragePagesPerMinute AveragePagesPerMinute

Gets the speed of the printer measured in pages per minute.

ClientPrintSchemaVersion ClientPrintSchemaVersion ClientPrintSchemaVersion ClientPrintSchemaVersion

Gets the version of the Print Schema.

Comment Comment Comment Comment

Gets or sets a comment about the printer.

CurrentJobSettings CurrentJobSettings CurrentJobSettings CurrentJobSettings

Gets an object that contains the configuration settings for the current print job.

DefaultPrintTicket DefaultPrintTicket DefaultPrintTicket DefaultPrintTicket

Gets or sets the default printer options associated with this PrintQueue.

DefaultPriority DefaultPriority DefaultPriority DefaultPriority

Gets or sets the default priority that is given to each new print job added to the queue.

Description Description Description Description

Gets a description of the print queue.

FullName FullName FullName FullName

Gets the complete name of the queue.

HasPaperProblem HasPaperProblem HasPaperProblem HasPaperProblem

Gets a value that indicates if the printer is having an unspecified paper problem.

HasToner HasToner HasToner HasToner

Gets a value that indicates if the printer has toner.

HostingPrintServer HostingPrintServer HostingPrintServer HostingPrintServer

Gets or sets (protected) the print server that controls the print queue.

InPartialTrust InPartialTrust InPartialTrust InPartialTrust

Gets or sets a value that indicates whether the queue is operating in a partially trusted mode, a higher level of trust.

IsBidiEnabled IsBidiEnabled IsBidiEnabled IsBidiEnabled

Gets a value that indicates whether bidirectional communication with the printer is enabled.

IsBusy IsBusy IsBusy IsBusy

Gets a value that indicates whether the printing device is busy.

IsDevQueryEnabled IsDevQueryEnabled IsDevQueryEnabled IsDevQueryEnabled

Gets a value that indicates whether the queue holds documents when document and printer configurations do not match.

IsDirect IsDirect IsDirect IsDirect

Gets a value that indicates whether the queue prints directly to the printer or spools documents first and then prints them.

IsDisposed IsDisposed IsDisposed IsDisposed

Gets or sets a value that indicates whether the object has been disposed.

(Inherited from PrintSystemObject)
IsDoorOpened IsDoorOpened IsDoorOpened IsDoorOpened

Gets a value that indicates whether a door is open on the printer.

IsHidden IsHidden IsHidden IsHidden

Gets a value that indicates whether the print queue is hidden in your application's user interface.

IsInError IsInError IsInError IsInError

Gets a value that indicates whether the printer or device is in an error condition.

IsInitializing IsInitializing IsInitializing IsInitializing

Gets a value that indicates whether the printer is initializing itself.

IsIOActive IsIOActive IsIOActive IsIOActive

Gets a value that indicates whether the printer is receiving or sending data or signals.

IsManualFeedRequired IsManualFeedRequired IsManualFeedRequired IsManualFeedRequired

Gets a value that indicates whether the printer needs to be manually fed paper for the current print job.

IsNotAvailable IsNotAvailable IsNotAvailable IsNotAvailable

Gets a value that indicates whether the printer is available.

IsOffline IsOffline IsOffline IsOffline

Gets a value that indicates whether the printer is offline.

IsOutOfMemory IsOutOfMemory IsOutOfMemory IsOutOfMemory

Gets a value that indicates whether the printer is out of memory.

IsOutOfPaper IsOutOfPaper IsOutOfPaper IsOutOfPaper

Gets a value that indicates whether the printer needs to be reloaded with paper of the size required for the current job.

IsOutputBinFull IsOutputBinFull IsOutputBinFull IsOutputBinFull

Gets a value that indicates whether the output area of the printer is in danger of overflowing.

IsPaperJammed IsPaperJammed IsPaperJammed IsPaperJammed

Gets a value that indicates whether the current sheet of paper is stuck in the printer.

IsPaused IsPaused IsPaused IsPaused

Gets a value that indicates whether the print queue has been paused.

IsPendingDeletion IsPendingDeletion IsPendingDeletion IsPendingDeletion

Gets a value that indicates whether the printer is in the process of deleting a print job.

IsPowerSaveOn IsPowerSaveOn IsPowerSaveOn IsPowerSaveOn

Gets a value that indicates whether the printer is in power save mode.

IsPrinting IsPrinting IsPrinting IsPrinting

Gets a value that indicates whether a job is printing.

IsProcessing IsProcessing IsProcessing IsProcessing

Gets a value that indicates whether the printer is processing a print job.

IsPublished IsPublished IsPublished IsPublished

Gets a value that indicates whether the printer is visible to other network users.

IsQueued IsQueued IsQueued IsQueued

Gets a value that indicates whether the printer can support a queue with more than one print job in it at a time.

IsRawOnlyEnabled IsRawOnlyEnabled IsRawOnlyEnabled IsRawOnlyEnabled

Gets a value that indicates whether the print queue can use EMF (Enhanced Meta File) that enables faster data flow from a printing application to the Windows spooler.

IsServerUnknown IsServerUnknown IsServerUnknown IsServerUnknown

Gets a value that indicates whether the printer is in an error state.

IsShared IsShared IsShared IsShared

Gets a value that indicates whether the printer is available for use by other computers on the network.

IsTonerLow IsTonerLow IsTonerLow IsTonerLow

Gets a value that indicates whether the printer is running short of toner.

IsWaiting IsWaiting IsWaiting IsWaiting

Gets a value that indicates whether the queue is waiting for a job to be added.

IsWarmingUp IsWarmingUp IsWarmingUp IsWarmingUp

Gets a value that indicates whether the printer is warming up.

IsXpsDevice IsXpsDevice IsXpsDevice IsXpsDevice

Gets a value that indicates whether the printer's driver is built on the Printing Overview so it uses XML Paper Specification (XPS) as its page description language.

KeepPrintedJobs KeepPrintedJobs KeepPrintedJobs KeepPrintedJobs

Gets a value that indicates whether the queue is saving the printer language file instead of deleting it following printing.

Location Location Location Location

Gets or sets the printer's physical location.

MaxPrintSchemaVersion MaxPrintSchemaVersion MaxPrintSchemaVersion MaxPrintSchemaVersion

Gets the most recent possible version number of the Print Schema that the queue can use.

Name Name Name Name

Gets or sets the print queue's name.

NeedUserIntervention NeedUserIntervention NeedUserIntervention NeedUserIntervention

Gets a value that indicates whether the printer needs the attention of a human being.

NumberOfJobs NumberOfJobs NumberOfJobs NumberOfJobs

Gets the total number of jobs lined up in the print queue.

PagePunt PagePunt PagePunt PagePunt

Gets a value that indicates whether the printer is unable to print the current page.

Parent Parent Parent Parent

Gets the parent of the object.

(Inherited from PrintSystemObject)
PrintingIsCancelled PrintingIsCancelled PrintingIsCancelled PrintingIsCancelled

Gets or sets a value that indicates whether the current print job is being cancelled.

Priority Priority Priority Priority

Gets or sets the priority of the print queue relative to other print queues that are hosted by the same print server and that use the same physical printer.

PropertiesCollection PropertiesCollection PropertiesCollection PropertiesCollection

Gets a collection of attribute and value pairs.

(Inherited from PrintSystemObject)
QueueAttributes QueueAttributes QueueAttributes QueueAttributes

Gets the properties of the print queue.

QueueDriver QueueDriver QueueDriver QueueDriver

Gets or sets the printer driver for the queue.

QueuePort QueuePort QueuePort QueuePort

Gets or sets the port that the queue uses.

QueuePrintProcessor QueuePrintProcessor QueuePrintProcessor QueuePrintProcessor

Gets or sets the print processor that the queue uses.

QueueStatus QueueStatus QueueStatus QueueStatus

Gets a value that represents the status of the printer. These include "warming up," "initializing," "printing," and others.

ScheduleCompletedJobsFirst ScheduleCompletedJobsFirst ScheduleCompletedJobsFirst ScheduleCompletedJobsFirst

Gets a value that indicates whether the printer prints jobs that have completed the spooling process before jobs that have not fully spooled even if the latter entered the queue first or have a higher priority.

SeparatorFile SeparatorFile SeparatorFile SeparatorFile

Gets or sets the path and file name of a file that is inserted at the beginning of each print job.

ShareName ShareName ShareName ShareName

Gets or sets a name for the printer that is seen by users on the network when it is shared.

StartTimeOfDay StartTimeOfDay StartTimeOfDay StartTimeOfDay

Gets or sets the earliest time of day, expressed as the number of minutes after midnight Coordinated Universal Time (UTC) (also called Greenwich Mean Time [GMT]), that the printer will print a job.

UntilTimeOfDay UntilTimeOfDay UntilTimeOfDay UntilTimeOfDay

Gets or sets the latest time, expressed as the number of minutes after midnight Coordinated Universal Time (UTC) (also called Greenwich Mean Time [GMT]), that the printer will print a job.

UserPrintTicket UserPrintTicket UserPrintTicket UserPrintTicket

Gets or sets the current user's default PrintTicket object which contains detailed information about the print job.

Methods

AddJob() AddJob() AddJob() AddJob()

Inserts a new (generically named) print job, whose content is a Byte array, into the queue.

AddJob(String) AddJob(String) AddJob(String) AddJob(String)

Inserts a new print job, whose content is a Byte array, into the queue.

AddJob(String, PrintTicket) AddJob(String, PrintTicket) AddJob(String, PrintTicket) AddJob(String, PrintTicket)

Inserts a new print job for an XML Paper Specification (XPS) Document into the queue, and gives it the specified name and settings.

AddJob(String, String, Boolean) AddJob(String, String, Boolean) AddJob(String, String, Boolean) AddJob(String, String, Boolean)

Inserts a new print job for an XML Paper Specification (XPS) Document into the queue, gives it the specified name, and specifies whether or not it should be validated.

AddJob(String, String, Boolean, PrintTicket) AddJob(String, String, Boolean, PrintTicket) AddJob(String, String, Boolean, PrintTicket) AddJob(String, String, Boolean, PrintTicket)

Inserts a new print job for an XML Paper Specification (XPS) Document into the queue, gives it the specified name and settings, and specifies whether or not it should be validated.

Commit() Commit() Commit() Commit()

Writes the current properties of the PrintQueue object to the actual print queue on the print server.

CreateXpsDocumentWriter(Double, Double) CreateXpsDocumentWriter(Double, Double) CreateXpsDocumentWriter(Double, Double) CreateXpsDocumentWriter(Double, Double)

Creates an XpsDocumentWriter object with the specified dimensions.

CreateXpsDocumentWriter(PrintDocumentImageableArea) CreateXpsDocumentWriter(PrintDocumentImageableArea) CreateXpsDocumentWriter(PrintDocumentImageableArea) CreateXpsDocumentWriter(PrintDocumentImageableArea)

Creates an XpsDocumentWriter object, opens a Windows common print dialog and returns a ref (ByRef in Visual Basic) parameter that represents information about the imageable area and the dimensions of the media.

CreateXpsDocumentWriter(PrintDocumentImageableArea, PageRangeSelection, PageRange) CreateXpsDocumentWriter(PrintDocumentImageableArea, PageRangeSelection, PageRange) CreateXpsDocumentWriter(PrintDocumentImageableArea, PageRangeSelection, PageRange) CreateXpsDocumentWriter(PrintDocumentImageableArea, PageRangeSelection, PageRange)

Creates an XpsDocumentWriter object, opens a Windows common print dialog, provides the dialog with a page range and a description of the print job, and returns a ref (ByRef in Visual Basic) parameter that represents information about the imageable area and the dimensions of the media.

CreateXpsDocumentWriter(PrintQueue) CreateXpsDocumentWriter(PrintQueue) CreateXpsDocumentWriter(PrintQueue) CreateXpsDocumentWriter(PrintQueue)

Creates an XpsDocumentWriter object and associates it with the specified print queue.

CreateXpsDocumentWriter(String, PrintDocumentImageableArea) CreateXpsDocumentWriter(String, PrintDocumentImageableArea) CreateXpsDocumentWriter(String, PrintDocumentImageableArea) CreateXpsDocumentWriter(String, PrintDocumentImageableArea)

Creates an XpsDocumentWriter object, opens a Windows common print dialog (and provides it a job description) and returns a ref (ByRef in Visual Basic) parameter that represents information about the imageable area and the dimensions of the media.

CreateXpsDocumentWriter(String, PrintDocumentImageableArea, PageRangeSelection, PageRange) CreateXpsDocumentWriter(String, PrintDocumentImageableArea, PageRangeSelection, PageRange) CreateXpsDocumentWriter(String, PrintDocumentImageableArea, PageRangeSelection, PageRange) CreateXpsDocumentWriter(String, PrintDocumentImageableArea, PageRangeSelection, PageRange)

Creates an XpsDocumentWriter object, opens a Windows common print dialog, provides the dialog with a page range, and returns a ref (ByRef in Visual Basic) parameter that represents information about the imageable area and the dimensions of the media.

Dispose() Dispose() Dispose() Dispose()

Releases all resources used by the PrintSystemObject.

(Inherited from PrintSystemObject)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Releases the unmanaged resources used by the PrintSystemObject and optionally releases the managed resources.

(Inherited from PrintSystemObject)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetJob(Int32) GetJob(Int32) GetJob(Int32) GetJob(Int32)

Gets the print job with the specified ID number.

GetPrintCapabilities() GetPrintCapabilities() GetPrintCapabilities() GetPrintCapabilities()

Gets a PrintCapabilities object that identifies the capabilities of the printer.

GetPrintCapabilities(PrintTicket) GetPrintCapabilities(PrintTicket) GetPrintCapabilities(PrintTicket) GetPrintCapabilities(PrintTicket)

Gets a PrintCapabilities object that identifies the capabilities of the printer.

GetPrintCapabilitiesAsXml() GetPrintCapabilitiesAsXml() GetPrintCapabilitiesAsXml() GetPrintCapabilitiesAsXml()

Gets a MemoryStream object that specifies the printer's capabilities as an XML stream that complies with the Print Schema.

GetPrintCapabilitiesAsXml(PrintTicket) GetPrintCapabilitiesAsXml(PrintTicket) GetPrintCapabilitiesAsXml(PrintTicket) GetPrintCapabilitiesAsXml(PrintTicket)

Gets a MemoryStream object that specifies the printer's capabilities in an XML format that complies with the Print Schema.

GetPrintJobInfoCollection() GetPrintJobInfoCollection() GetPrintJobInfoCollection() GetPrintJobInfoCollection()

Creates a collection that contains a PrintSystemJobInfo object for each job in the queue.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
Initialize() Initialize() Initialize() Initialize()

Initializes the properties of the PrintSystemObject.

(Inherited from PrintSystemObject)
InternalDispose(Boolean) InternalDispose(Boolean) InternalDispose(Boolean) InternalDispose(Boolean)

Releases the unmanaged resources used by the PrintQueue and optionally releases the managed resources.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
MergeAndValidatePrintTicket(PrintTicket, PrintTicket) MergeAndValidatePrintTicket(PrintTicket, PrintTicket) MergeAndValidatePrintTicket(PrintTicket, PrintTicket) MergeAndValidatePrintTicket(PrintTicket, PrintTicket)

Merges two PrintTickets and guarantees that the resulting PrintTicket is valid and does not ask for any printing functionality that the printer does not support.

MergeAndValidatePrintTicket(PrintTicket, PrintTicket, PrintTicketScope) MergeAndValidatePrintTicket(PrintTicket, PrintTicket, PrintTicketScope) MergeAndValidatePrintTicket(PrintTicket, PrintTicket, PrintTicketScope) MergeAndValidatePrintTicket(PrintTicket, PrintTicket, PrintTicketScope)

Merges two PrintTickets and guarantees that the resulting PrintTicket is valid, does not ask for any printing functionality that the printer does not support, and is limited to the specified scope.

Pause() Pause() Pause() Pause()

Pauses the print queue. It remains paused until Resume() is executed.

Purge() Purge() Purge() Purge()

Removes all the jobs in the print queue.

Refresh() Refresh() Refresh() Refresh()

Updates the properties of the PrintQueue object with values from the printer and the print queue utility that runs on the computer.

Resume() Resume() Resume() Resume()

Restarts a print queue that was paused.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See Also