Export (0) Print
Expand All

PrintQueue Class

Manages printers and print jobs.

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

'Declaration
<PrintingPermissionAttribute(SecurityAction.InheritanceDemand, Level := PrintingPermissionLevel.DefaultPrinting)> _
Public Class PrintQueue _
	Inherits PrintSystemObject

The PrintQueue type exposes the following members.

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

  NameDescription
Public propertyAveragePagesPerMinuteGets the speed of the printer measured in pages per minute.
Public propertyClientPrintSchemaVersionGets the version of the Print Schema.
Public propertyCommentGets or sets a comment about the printer.
Public propertyCurrentJobSettingsGets an object that contains the configuration settings for the current print job.
Public propertyDefaultPrintTicketGets or sets the default printer options associated with this PrintQueue.
Public propertyDefaultPriorityGets or sets the default priority that is given to each new print job added to the queue.
Public propertyDescriptionGets a description of the print queue.
Public propertyFullNameGets the complete name of the queue.
Public propertyHasPaperProblemGets a value that indicates if the printer is having an unspecified paper problem.
Public propertyHasTonerGets a value that indicates if the printer has toner.
Public propertyHostingPrintServerGets or sets (protected) the print server that controls the print queue.
Public propertyInPartialTrustGets or sets a value that indicates whether the queue is operating in a partially trusted mode, a higher level of trust.
Public propertyIsBidiEnabledGets a value that indicates whether bidirectional communication with the printer is enabled.
Public propertyIsBusyGets a value that indicates whether the printing device is busy.
Public propertyIsDevQueryEnabledGets a value that indicates whether the queue holds documents when document and printer configurations do not match.
Public propertyIsDirectGets a value that indicates whether the queue prints directly to the printer or spools documents first and then prints them.
Protected propertyIsDisposedGets or sets a value that indicates whether the object has been disposed. (Inherited from PrintSystemObject.)
Public propertyIsDoorOpenedGets a value that indicates whether a door is open on the printer.
Public propertyIsHiddenGets a value that indicates whether the print queue is hidden in your application's user interface.
Public propertyIsInErrorGets a value that indicates whether the printer or device is in an error condition.
Public propertyIsInitializingGets a value that indicates whether the printer is initializing itself.
Public propertyIsIOActiveGets a value that indicates whether the printer is receiving or sending data or signals.
Public propertyIsManualFeedRequiredGets a value that indicates whether the printer needs to be manually fed paper for the current print job.
Public propertyIsNotAvailableGets a value that indicates whether the printer is available.
Public propertyIsOfflineGets a value that indicates whether the printer is offline.
Public propertyIsOutOfMemoryGets a value that indicates whether the printer is out of memory.
Public propertyIsOutOfPaperGets a value that indicates whether the printer needs to be reloaded with paper of the size required for the current job.
Public propertyIsOutputBinFullGets a value that indicates whether the output area of the printer is in danger of overflowing.
Public propertyIsPaperJammedGets a value that indicates whether the current sheet of paper is stuck in the printer.
Public propertyIsPausedGets a value that indicates whether the print queue has been paused.
Public propertyIsPendingDeletionGets a value that indicates whether the printer is in the process of deleting a print job.
Public propertyIsPowerSaveOnGets a value that indicates whether the printer is in power save mode.
Public propertyIsPrintingGets a value that indicates whether a job is printing.
Public propertyIsProcessingGets a value that indicates whether the printer is processing a print job.
Public propertyIsPublishedGets a value that indicates whether the printer is visible to other network users.
Public propertyIsQueuedGets a value that indicates whether the printer can support a queue with more than one print job in it at a time.
Public propertyIsRawOnlyEnabledGets 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 propertyIsServerUnknownGets a value that indicates whether the printer is in an error state.
Public propertyIsSharedGets a value that indicates whether the printer is available for use by other computers on the network.
Public propertyIsTonerLowGets a value that indicates whether the printer is running short of toner.
Public propertyIsWaitingGets a value that indicates whether the queue is waiting for a job to be added.
Public propertyIsWarmingUpGets a value that indicates whether the printer is warming up.
Public propertyIsXpsDeviceGets 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 propertyKeepPrintedJobsGets a value that indicates whether the queue is saving the printer language file instead of deleting it following printing.
Public propertyLocationGets or sets the printer's physical location.
Public propertyStatic memberMaxPrintSchemaVersionGets the most recent possible version number of the Print Schema that the queue can use.
Public propertyNameGets or sets the print queue's name. (Overrides PrintSystemObject.Name.)
Public propertyNeedUserInterventionGets a value that indicates whether the printer needs the attention of a human being.
Public propertyNumberOfJobsGets the total number of jobs lined up in the print queue.
Public propertyPagePuntGets a value that indicates whether the printer is unable to print the current page.
Public propertyParentGets the parent of the object. (Inherited from PrintSystemObject.)
Public propertyPrintingIsCancelledGets or sets a value that indicates whether the current print job is being cancelled.
Public propertyPriorityGets 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 propertyPropertiesCollectionGets a collection of attribute and value pairs. (Inherited from PrintSystemObject.)
Public propertyQueueAttributesGets the properties of the print queue.
Public propertyQueueDriverGets or sets the printer driver for the queue.
Public propertyQueuePortGets or sets the port that the queue uses.
Public propertyQueuePrintProcessorGets or sets the print processor that the queue uses.
Public propertyQueueStatusGets a value that represents the status of the printer. These include "warming up," "initializing," "printing," and others.
Public propertyScheduleCompletedJobsFirstGets 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 propertySeparatorFileGets or sets the path and file name of a file that is inserted at the beginning of each print job.
Public propertyShareNameGets or sets a name for the printer that is seen by users on the network when it is shared.
Public propertyStartTimeOfDayGets 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 propertyUntilTimeOfDayGets 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 propertyUserPrintTicketGets or sets the current user's default PrintTicket object which contains detailed information about the print job.
Top

  NameDescription
Public methodAddJobInserts a new (generically named) print job, whose content is a Byte array, into the queue.
Public methodAddJob(String)Inserts a new print job, whose content is a Byte array, into the queue.
Public methodAddJob(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 methodCommitWrites the current properties of the PrintQueue object to the actual print queue on the print server. (Overrides PrintSystemObject.Commit.)
Public methodStatic memberCreateXpsDocumentWriter(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 methodStatic memberCreateXpsDocumentWriter(PrintQueue)Creates an XpsDocumentWriter object and associates it with the specified print queue.
Public methodStatic memberCreateXpsDocumentWriter(Double, Double)Creates an XpsDocumentWriter object with the specified dimensions.
Public methodStatic memberCreateXpsDocumentWriter(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 methodStatic memberCreateXpsDocumentWriter(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 methodStatic memberCreateXpsDocumentWriter(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 methodDisposeReleases all resources used by the PrintSystemObject. (Inherited from PrintSystemObject.)
Protected methodDispose(Boolean)Releases the unmanaged resources used by the PrintSystemObject and optionally releases the managed resources. (Inherited from PrintSystemObject.)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeReleases the resources that are being used by the PrintSystemObject. (Inherited from PrintSystemObject.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetJobGets the print job with the specified ID number.
Public methodGetPrintCapabilitiesGets a PrintCapabilities object that identifies the capabilities of the printer.
Public methodGetPrintCapabilities(PrintTicket)Gets a PrintCapabilities object that identifies the capabilities of the printer.
Public methodGetPrintCapabilitiesAsXmlGets a MemoryStream object that specifies the printer's capabilities as an XML stream that complies with the Print Schema.
Public methodGetPrintCapabilitiesAsXml(PrintTicket)Gets a MemoryStream object that specifies the printer's capabilities in an XML format that complies with the Print Schema.
Public methodGetPrintJobInfoCollectionCreates a collection that contains a PrintSystemJobInfo object for each job in the queue.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodInitializeInitializes the properties of the PrintSystemObject. (Inherited from PrintSystemObject.)
Protected methodInternalDisposeReleases the unmanaged resources used by the PrintQueue and optionally releases the managed resources. (Overrides PrintSystemObject.InternalDispose(Boolean).)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodMergeAndValidatePrintTicket(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 methodMergeAndValidatePrintTicket(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 methodPausePauses the print queue. It remains paused until Resume is executed.
Public methodPurgeRemoves all the jobs in the print queue.
Public methodRefreshUpdates 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 methodResumeRestarts a print queue that was paused.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

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.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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.

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

Community Additions

ADD
Show:
© 2014 Microsoft