PrintQueueStream Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A stream that represents a spooled print job in a print queue.
public ref class PrintQueueStream : System::IO::Stream
public class PrintQueueStream : System.IO.Stream
type PrintQueueStream = class
inherit Stream
Public Class PrintQueueStream
Inherits Stream
- Inheritance
Remarks
Use this class to write device specific information to a spool file that is not automatically included by the Microsoft Windows spooler. Of course, you need to know whether the spool file is Enhanced Metafile (EMF) or XML Paper Specification (XPS). If you prefer working with a Byte array, you can also use two of the overloads of the AddJob method and the JobStream property to write to the spool file.
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
| Name | Description |
|---|---|
| PrintQueueStream(PrintQueue, String, Boolean, PrintTicket) |
Initializes a new instance of the PrintQueueStream class for the specified print job that is hosted in the specified PrintQueue, with the specified settings and an indication of whether data in the PrintQueueStream should be committed when the stream is closed. |
| PrintQueueStream(PrintQueue, String, Boolean) |
Initializes a new instance of the PrintQueueStream class for the specified print job that is hosted in the specified PrintQueue, with an indication of whether data in the PrintQueueStream should be committed when the stream is closed. |
| PrintQueueStream(PrintQueue, String) |
Initializes a new instance of the PrintQueueStream class for the specified print job that is hosted in the specified PrintQueue. |
Properties
| Name | Description |
|---|---|
| CanRead |
Gets a value that indicates whether the stream supports reading. |
| CanSeek |
Gets a value that indicates whether the stream supports seeking, which is moving the read/write position to a new position in the stream. |
| CanWrite |
Gets a value that indicates whether the stream supports writing. |
| JobIdentifier |
Gets the ID number of the print job. |
| Length |
Gets the length of the stream in bytes. |
| Position |
Gets or sets the current read/write position in the stream. |
Methods
| Name | Description |
|---|---|
| BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) |
Begins an asynchronous write operation. |
| Close() |
Closes the stream and releases any resources, such as sockets and file handles, that are associated with it. |
| Dispose(Boolean) |
Releases the unmanaged resources that are used by the PrintQueueStream and optionally releases the managed resources. |
| EndWrite(IAsyncResult) |
Ends an asynchronous write operation. |
| Finalize() |
Enables a PrintQueueStream to attempt to free resources and perform other cleanup operations before the PrintQueueStream is reclaimed by garbage collection. |
| Flush() |
Clears all the buffers for this stream and writes any buffered data to the underlying device. |
| HandlePackagingProgressEvent(Object, PackagingProgressEventArgs) |
Enables the PrintQueueStream to respond to the packaging progress by handling the PackagingProgressEvent. |
| Read(Byte[], Int32, Int32) |
Reads a sequence of bytes from the stream and advances the read/write position in the stream by the number of bytes that were read. |
| Seek(Int64, SeekOrigin) |
Sets the read/write position within the stream. |
| SetLength(Int64) |
Sets the length of the stream. |
| Write(Byte[], Int32, Int32) |
Writes a sequence of bytes to the stream and advances the read/write position in the stream by the number of bytes that are written. |