Export (0) Print
Expand All

PrintTicket Constructor (Stream)

Initializes a new instance of the PrintTicket class by using an XML stream (that contains a PrintTicket document) that complies with the XML Print Schema.

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

public PrintTicket(
	Stream xmlStream
)

Parameters

xmlStream
Type: System.IO.Stream

An XML stream that describes a print job and conforms to the Print Schema.

ExceptionCondition
ArgumentNullException

xmlStream is null.

FormatException

xmlStream is not valid XML.

The constructor does not reset the read-write position of the stream back to its original position. Accordingly, you should reset it immediately after calling the constructor.

The entire PrintTicket document is stored in a non-public field in the object, including the XML elements within it that express less common features that are not represented by any of the public properties of the PrintTicket class. In fact, if the driver that produced the PrintTicket document is using a private extension of the Print Schema, that privately defined markup is also stored as part of the non-public PrintTicket document.

The private parts of the document, if any, are not validated by the constructor, but all Print Schema-defined parts are validated, including the parts that are not represented by any of the public properties of the PrintTicket class. Accordingly, the FormatException could be thrown even if all of the XML markup that corresponds to the public properties is valid.

When any of the properties of the PrintTicket are written to, this non-public PrintTicket document is changed as well.

It is this non-public PrintTicket document that is returned by the GetXmlStream and SaveTo methods.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft