PrintQueue Class (System.Printing)

Switch View :
ScriptFree
.NET Framework Class Library
PrintQueue Class

Manages printers and print jobs.

Inheritance Hierarchy

System.Object
  System.Printing.PrintSystemObject
    System.Printing.PrintQueue

Namespace:  System.Printing
Assembly:  System.Printing (in System.Printing.dll)
Syntax

Visual Basic
<PrintingPermissionAttribute(SecurityAction.InheritanceDemand, Level := PrintingPermissionLevel.DefaultPrinting)> _
Public Class PrintQueue _
	Inherits PrintSystemObject
C#
[PrintingPermissionAttribute(SecurityAction.InheritanceDemand, Level = PrintingPermissionLevel.DefaultPrinting)]
public class PrintQueue : PrintSystemObject
Visual C++
[PrintingPermissionAttribute(SecurityAction::InheritanceDemand, Level = PrintingPermissionLevel::DefaultPrinting)]
public ref class PrintQueue : public PrintSystemObject
F#
[<PrintingPermissionAttribute(SecurityAction.InheritanceDemand, Level = PrintingPermissionLevel.DefaultPrinting)>]
type PrintQueue =  
    class
        inherit PrintSystemObject
    end

The PrintQueue type exposes the following members.

Constructors

  Name Description
Public method PrintQueue(PrintServer, String) Initializes a new instance of PrintQueue class using the specified PrintServer and queue name.
Public method PrintQueue(PrintServer, String, Int32) Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, and print schema version.
Public method PrintQueue(PrintServer, String, PrintQueueIndexedProperty[]) Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, and array of PrintQueueIndexedProperty values to initialize.
Public method PrintQueue(PrintServer, String, PrintSystemDesiredAccess) Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, and desired access.
Public method PrintQueue(PrintServer, String, String[]) Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, and array of property names to initialize.
Public method PrintQueue(PrintServer, String, Int32, PrintSystemDesiredAccess) Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, print schema version, and desired access.
Public method 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.
Public method PrintQueue(PrintServer, String, String[], PrintSystemDesiredAccess) Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, property filter, and desired access.
Top
Properties

  Name Description
Public property AveragePagesPerMinute Gets the speed of the printer measured in pages per minute.
Public property ClientPrintSchemaVersion Gets the version of the Print Schema.
Public property Comment Gets or sets a comment about the printer.
Public property CurrentJobSettings Gets an object that contains the configuration settings for the current print job.
Public property DefaultPrintTicket Gets or sets the default printer options associated with this PrintQueue.
Public property DefaultPriority Gets or sets the default priority that is given to each new print job added to the queue.
Public property Description Gets a description of the print queue.
Public property FullName Gets the complete name of the queue.
Public property HasPaperProblem Gets a value that indicates if the printer is having an unspecified paper problem.
Public property HasToner Gets a value that indicates if the printer has toner.
Public property HostingPrintServer Gets or sets (protected) the print server that controls the print queue.
Public property InPartialTrust Gets or sets a value that indicates whether the queue is operating in a partially trusted mode, a higher level of trust.
Public property IsBidiEnabled Gets a value that indicates whether bidirectional communication with the printer is enabled.
Public property IsBusy Gets a value that indicates whether the printing device is busy.
Public property IsDevQueryEnabled Gets a value that indicates whether the queue holds documents when document and printer configurations do not match.
Public property IsDirect Gets a value that indicates whether the queue prints directly to the printer or spools documents first and then prints them.
Protected property IsDisposed Gets or sets a value that indicates whether the object has been disposed. (Inherited from PrintSystemObject.)
Public property IsDoorOpened Gets a value that indicates whether a door is open on the printer.
Public property IsHidden Gets a value that indicates whether the print queue is hidden in your application's user interface.
Public property IsInError Gets a value that indicates whether the printer or device is in an error condition.
Public property IsInitializing Gets a value that indicates whether the printer is initializing itself.
Public property IsIOActive Gets a value that indicates whether the printer is receiving or sending data or signals.
Public property IsManualFeedRequired Gets a value that indicates whether the printer needs to be manually fed paper for the current print job.
Public property IsNotAvailable Gets a value that indicates whether the printer is available.
Public property IsOffline Gets a value that indicates whether the printer is offline.
Public property IsOutOfMemory Gets a value that indicates whether the printer is out of memory.
Public property IsOutOfPaper Gets a value that indicates whether the printer needs to be reloaded with paper of the size required for the current job.
Public property IsOutputBinFull Gets a value that indicates whether the output area of the printer is in danger of overflowing.
Public property IsPaperJammed Gets a value that indicates whether the current sheet of paper is stuck in the printer.
Public property IsPaused Gets a value that indicates whether the print queue has been paused.
Public property IsPendingDeletion Gets a value that indicates whether the printer is in the process of deleting a print job.
Public property IsPowerSaveOn Gets a value that indicates whether the printer is in power save mode.
Public property IsPrinting Gets a value that indicates whether a job is printing.
Public property IsProcessing Gets a value that indicates whether the printer is processing a print job.
Public property IsPublished Gets a value that indicates whether the printer is visible to other network users.
Public property IsQueued Gets a value that indicates whether the printer can support a queue with more than one print job in it at a time.
Public property 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.
Public property IsServerUnknown Gets a value that indicates whether the printer is in an error state.
Public property IsShared Gets a value that indicates whether the printer is available for use by other computers on the network.
Public property IsTonerLow Gets a value that indicates whether the printer is running short of toner.
Public property IsWaiting Gets a value that indicates whether the queue is waiting for a job to be added.
Public property IsWarmingUp Gets a value that indicates whether the printer is warming up.
Public property 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. 
Public property KeepPrintedJobs Gets a value that indicates whether the queue is saving the printer language file instead of deleting it following printing.
Public property Location Gets or sets the printer's physical location.
Public property Static member MaxPrintSchemaVersion Gets the most recent possible version number of the Print Schema that the queue can use.
Public property Name Gets or sets the print queue's name. (Overrides PrintSystemObject.Name.)
Public property NeedUserIntervention Gets a value that indicates whether the printer needs the attention of a human being.
Public property NumberOfJobs Gets the total number of jobs lined up in the print queue.
Public property PagePunt Gets a value that indicates whether the printer is unable to print the current page.
Public property Parent Gets the parent of the object. (Inherited from PrintSystemObject.)
Public property PrintingIsCancelled Gets or sets a value that indicates whether the current print job is being cancelled.
Public property 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.
Public property PropertiesCollection Gets a collection of attribute and value pairs. (Inherited from PrintSystemObject.)
Public property QueueAttributes Gets the properties of the print queue.
Public property QueueDriver Gets or sets the printer driver for the queue.
Public property QueuePort Gets or sets the port that the queue uses.
Public property QueuePrintProcessor Gets or sets the print processor that the queue uses.
Public property QueueStatus Gets a value that represents the status of the printer. These include "warming up," "initializing," "printing," and others.
Public property 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.
Public property SeparatorFile Gets or sets the path and file name of a file that is inserted at the beginning of each print job.
Public property ShareName Gets or sets a name for the printer that is seen by users on the network when it is shared.
Public property 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.
Public property 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.
Public property UserPrintTicket Gets or sets the current user's default PrintTicket object which contains detailed information about the print job.
Top
Methods

  Name Description
Public method AddJob() Inserts a new (generically named) print job, whose content is a Byte array, into the queue.
Public method AddJob(String) Inserts a new print job, whose content is a Byte array, into the queue.
Public method 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.
Public method Commit Writes the current properties of the PrintQueue object to the actual print queue on the print server. (Overrides PrintSystemObject.Commit().)
Public method Static member 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.
Public method Static member CreateXpsDocumentWriter(PrintQueue) Creates an XpsDocumentWriter object and associates it with the specified print queue.
Public method Static member CreateXpsDocumentWriter(Double, Double) Creates an XpsDocumentWriter object with the specified dimensions.
Public method Static member 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.
Public method Static member 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.
Public method Static member 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.
Public method Dispose() Releases all resources used by the PrintSystemObject. (Inherited from PrintSystemObject.)
Protected method Dispose(Boolean) Releases the unmanaged resources used by the PrintSystemObject and optionally releases the managed resources. (Inherited from PrintSystemObject.)
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Releases the resources that are being used by the PrintSystemObject. (Inherited from PrintSystemObject.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetJob Gets the print job with the specified ID number.
Public method GetPrintCapabilities() Gets a PrintCapabilities object that identifies the capabilities of the printer.
Public method GetPrintCapabilities(PrintTicket) Gets a PrintCapabilities object that identifies the capabilities of the printer.
Public method GetPrintCapabilitiesAsXml() Gets a MemoryStream object that specifies the printer's capabilities as an XML stream that complies with the Print Schema.
Public method GetPrintCapabilitiesAsXml(PrintTicket) Gets a MemoryStream object that specifies the printer's capabilities in an XML format that complies with the Print Schema.
Public method GetPrintJobInfoCollection Creates a collection that contains a PrintSystemJobInfo object for each job in the queue.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method Initialize Initializes the properties of the PrintSystemObject. (Inherited from PrintSystemObject.)
Protected method InternalDispose Releases the unmanaged resources used by the PrintQueue and optionally releases the managed resources. (Overrides PrintSystemObject.InternalDispose(Boolean).)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method 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.
Public method 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.
Public method Pause Pauses the print queue. It remains paused until Resume is executed.
Public method Purge Removes all the jobs in the print queue.
Public method Refresh Updates the properties of the PrintQueue object with values from the printer and the print queue utility that runs on the computer. (Overrides PrintSystemObject.Refresh().)
Public method Resume Restarts a print queue that was paused.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Top
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.

Version Information

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also

Reference

Other Resources