XpsDocumentWriter Class (System.Windows.Xps)

Switch View :
ScriptFree
.NET Framework Class Library
XpsDocumentWriter Class

Provides methods to write to an XPS document or print queue.  

Inheritance Hierarchy

System.Object
  System.Windows.Documents.Serialization.SerializerWriter
    System.Windows.Xps.XpsDocumentWriter

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

Visual Basic
Public Class XpsDocumentWriter _
	Inherits SerializerWriter
C#
public class XpsDocumentWriter : SerializerWriter
Visual C++
public ref class XpsDocumentWriter : public SerializerWriter
F#
type XpsDocumentWriter =  
    class
        inherit SerializerWriter
    end

The XpsDocumentWriter type exposes the following members.

Methods

  Name Description
Public method CancelAsync Cancels the current WriteAsync operation. (Overrides SerializerWriter.CancelAsync().)
Public method CreateVisualsCollator() Returns a VisualsToXpsDocument that can write Visual objects to a document or print queue. (Overrides SerializerWriter.CreateVisualsCollator().)
Public method CreateVisualsCollator(PrintTicket, PrintTicket) Returns a VisualsToXpsDocument that can write Visual objects with PrintTicket settings to an XPS document or print queue. (Overrides SerializerWriter.CreateVisualsCollator(PrintTicket, PrintTicket).)
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method Write(DocumentPaginator) Writes synchronously paginated content from a specified DocumentPaginator to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(DocumentPaginator).)
Public method Write(FixedDocument) Writes synchronously a specified FixedDocument to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(FixedDocument).)
Public method Write(FixedDocumentSequence) Writes synchronously a specified FixedDocumentSequence to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(FixedDocumentSequence).)
Public method Write(FixedPage) Writes synchronously a specified FixedPage to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(FixedPage).)
Public method Write(String) Writes synchronously a specified XPS document to the target XpsDocument or PrintQueue.
Public method Write(Visual) Writes synchronously a specified Visual to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(Visual).)
Public method Write(DocumentPaginator, PrintTicket) Writes synchronously paginated content from a specified DocumentPaginator together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(DocumentPaginator, PrintTicket).)
Public method Write(FixedDocument, PrintTicket) Writes synchronously a FixedDocument together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(FixedDocument, PrintTicket).)
Public method Write(FixedDocumentSequence, PrintTicket) Writes synchronously a specified FixedDocumentSequence together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(FixedDocumentSequence, PrintTicket).)
Public method Write(FixedPage, PrintTicket) Writes synchronously a specified FixedPage together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(FixedPage, PrintTicket).)
Public method Write(String, XpsDocumentNotificationLevel) Writes synchronously a specified XPS document to the target XpsDocument or PrintQueue.
Public method Write(Visual, PrintTicket) Writes synchronously a specified Visual together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(Visual, PrintTicket).)
Public method WriteAsync(DocumentPaginator) Writes asynchronously paginated content from a specified DocumentPaginator to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(DocumentPaginator).)
Public method WriteAsync(FixedDocument) Writes asynchronously a specified FixedDocument to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedDocument).)
Public method WriteAsync(FixedDocumentSequence) Writes asynchronously a specified FixedDocumentSequence to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedDocumentSequence).)
Public method WriteAsync(FixedPage) Writes asynchronously a specified FixedPage to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedPage).)
Public method WriteAsync(String) Writes asynchronously a specified XPS document to the target XpsDocument or PrintQueue.
Public method WriteAsync(Visual) Writes asynchronously a specified Visual to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(Visual).)
Public method WriteAsync(DocumentPaginator, Object) Writes asynchronously paginated content from a specified DocumentPaginator to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(DocumentPaginator, Object).)
Public method WriteAsync(DocumentPaginator, PrintTicket) Writes asynchronously paginated content from a specified DocumentPaginator together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(DocumentPaginator, PrintTicket).)
Public method WriteAsync(FixedDocument, Object) Writes asynchronously a specified FixedDocument to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedDocument, Object).)
Public method WriteAsync(FixedDocument, PrintTicket) Writes asynchronously a specified FixedDocument together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedDocument, PrintTicket).)
Public method WriteAsync(FixedDocumentSequence, Object) Writes asynchronously a specified FixedDocumentSequence to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedDocumentSequence, Object).)
Public method WriteAsync(FixedDocumentSequence, PrintTicket) Writes asynchronously a specified FixedDocumentSequence together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedDocumentSequence, PrintTicket).)
Public method WriteAsync(FixedPage, Object) Writes asynchronously a specified FixedPage to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedPage, Object).)
Public method WriteAsync(FixedPage, PrintTicket) Writes asynchronously a specified FixedPage together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedPage, PrintTicket).)
Public method WriteAsync(String, XpsDocumentNotificationLevel) Writes asynchronously a specified XPS document with notification option to the target XpsDocument or PrintQueue.
Public method WriteAsync(Visual, Object) Writes asynchronously a specified Visual to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(Visual, Object).)
Public method WriteAsync(Visual, PrintTicket) Writes asynchronously a specified Visual together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(Visual, PrintTicket).)
Public method WriteAsync(DocumentPaginator, PrintTicket, Object) Writes asynchronously paginated content from a specified DocumentPaginator together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(DocumentPaginator, PrintTicket, Object).)
Public method WriteAsync(FixedDocument, PrintTicket, Object) Writes asynchronously a specified FixedDocument together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedDocument, PrintTicket, Object).)
Public method WriteAsync(FixedDocumentSequence, PrintTicket, Object) Writes asynchronously a specified FixedDocumentSequence together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedDocumentSequence, PrintTicket, Object).)
Public method WriteAsync(FixedPage, PrintTicket, Object) Writes asynchronously a specified FixedPage together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedPage, PrintTicket, Object).)
Public method WriteAsync(Visual, PrintTicket, Object) Writes asynchronously a specified Visual together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(Visual, PrintTicket, Object).)
Top
Events

  Name Description
Protected event _WritingCancelled Occurs when a Write or WriteAsync operation is canceled.
Protected event _WritingCompleted Occurs when a write operation finishes.
Protected event _WritingProgressChanged Occurs when the XpsDocumentWriter updates its progress.
Public event WritingCancelled Occurs when a Write or WriteAsync operation is canceled. (Overrides SerializerWriter.WritingCancelled.)
Public event WritingCompleted Occurs when a write operation finishes. (Overrides SerializerWriter.WritingCompleted.)
Public event WritingPrintTicketRequired Occurs just before a Write or WriteAsync method adds a PrintTicket to a document or print queue. (Overrides SerializerWriter.WritingPrintTicketRequired.)
Public event WritingProgressChanged Occurs when the XpsDocumentWriter updates its progress. (Overrides SerializerWriter.WritingProgressChanged.)
Top
Remarks

XpsDocumentWriter has no constructor. To create an XpsDocumentWriter, use the static CreateXpsDocumentWriter method of the XpsDocument class or use one of the static CreateXpsDocumentWriter methods of the PrintQueue class. The document or the queue that creates the XpsDocumentWriter becomes the target to which it writes.

Examples

The following example shows how to create an instance of the XpsDocumentWriter class.

Visual Basic


			_xpsDocument = New XpsDocument(containerName,FileAccess.ReadWrite)

			Dim xpsdw As XpsDocumentWriter = XpsDocument.CreateXpsDocumentWriter(_xpsDocument)



C#


            _xpsDocument = new XpsDocument(containerName,FileAccess.ReadWrite);

            XpsDocumentWriter xpsdw = XpsDocument.CreateXpsDocumentWriter(_xpsDocument);



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