Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

XpsDocumentWriter Class

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

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

public class XpsDocumentWriter : SerializerWriter

The XpsDocumentWriter type exposes the following members.

  NameDescription
Public methodCancelAsyncCancels the current WriteAsync operation. (Overrides SerializerWriter.CancelAsync().)
Public methodCreateVisualsCollator()Returns a VisualsToXpsDocument that can write Visual objects to a document or print queue. (Overrides SerializerWriter.CreateVisualsCollator().)
Public methodCreateVisualsCollator(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 methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodWrite(DocumentPaginator)Writes synchronously paginated content from a specified DocumentPaginator to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(DocumentPaginator).)
Public methodWrite(FixedDocument)Writes synchronously a specified FixedDocument to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(FixedDocument).)
Public methodWrite(FixedDocumentSequence)Writes synchronously a specified FixedDocumentSequence to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(FixedDocumentSequence).)
Public methodWrite(FixedPage)Writes synchronously a specified FixedPage to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(FixedPage).)
Public methodWrite(String)Writes synchronously a specified XPS document to the target XpsDocument or PrintQueue.
Public methodWrite(Visual)Writes synchronously a specified Visual to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(Visual).)
Public methodWrite(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 methodWrite(FixedDocument, PrintTicket)Writes synchronously a FixedDocument together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(FixedDocument, PrintTicket).)
Public methodWrite(FixedDocumentSequence, PrintTicket)Writes synchronously a specified FixedDocumentSequence together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(FixedDocumentSequence, PrintTicket).)
Public methodWrite(FixedPage, PrintTicket)Writes synchronously a specified FixedPage together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(FixedPage, PrintTicket).)
Public methodWrite(String, XpsDocumentNotificationLevel)Writes synchronously a specified XPS document to the target XpsDocument or PrintQueue.
Public methodWrite(Visual, PrintTicket)Writes synchronously a specified Visual together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.Write(Visual, PrintTicket).)
Public methodWriteAsync(DocumentPaginator)Writes asynchronously paginated content from a specified DocumentPaginator to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(DocumentPaginator).)
Public methodWriteAsync(FixedDocument)Writes asynchronously a specified FixedDocument to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedDocument).)
Public methodWriteAsync(FixedDocumentSequence)Writes asynchronously a specified FixedDocumentSequence to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedDocumentSequence).)
Public methodWriteAsync(FixedPage)Writes asynchronously a specified FixedPage to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedPage).)
Public methodWriteAsync(String)Writes asynchronously a specified XPS document to the target XpsDocument or PrintQueue.
Public methodWriteAsync(Visual)Writes asynchronously a specified Visual to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(Visual).)
Public methodWriteAsync(DocumentPaginator, Object)Writes asynchronously paginated content from a specified DocumentPaginator to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(DocumentPaginator, Object).)
Public methodWriteAsync(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 methodWriteAsync(FixedDocument, Object)Writes asynchronously a specified FixedDocument to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedDocument, Object).)
Public methodWriteAsync(FixedDocument, PrintTicket)Writes asynchronously a specified FixedDocument together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedDocument, PrintTicket).)
Public methodWriteAsync(FixedDocumentSequence, Object)Writes asynchronously a specified FixedDocumentSequence to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedDocumentSequence, Object).)
Public methodWriteAsync(FixedDocumentSequence, PrintTicket)Writes asynchronously a specified FixedDocumentSequence together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedDocumentSequence, PrintTicket).)
Public methodWriteAsync(FixedPage, Object)Writes asynchronously a specified FixedPage to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedPage, Object).)
Public methodWriteAsync(FixedPage, PrintTicket)Writes asynchronously a specified FixedPage together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(FixedPage, PrintTicket).)
Public methodWriteAsync(String, XpsDocumentNotificationLevel)Writes asynchronously a specified XPS document with notification option to the target XpsDocument or PrintQueue.
Public methodWriteAsync(Visual, Object)Writes asynchronously a specified Visual to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(Visual, Object).)
Public methodWriteAsync(Visual, PrintTicket)Writes asynchronously a specified Visual together with a PrintTicket to the target XpsDocument or PrintQueue. (Overrides SerializerWriter.WriteAsync(Visual, PrintTicket).)
Public methodWriteAsync(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 methodWriteAsync(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 methodWriteAsync(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 methodWriteAsync(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 methodWriteAsync(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

  NameDescription
Protected event_WritingCancelledOccurs when a Write or WriteAsync operation is canceled.
Protected event_WritingCompletedOccurs when a write operation finishes.
Protected event_WritingProgressChangedOccurs when the XpsDocumentWriter updates its progress.
Public eventWritingCancelledOccurs when a Write or WriteAsync operation is canceled. (Overrides SerializerWriter.WritingCancelled.)
Public eventWritingCompletedOccurs when a write operation finishes. (Overrides SerializerWriter.WritingCompleted.)
Public eventWritingPrintTicketRequiredOccurs just before a Write or WriteAsync method adds a PrintTicket to a document or print queue. (Overrides SerializerWriter.WritingPrintTicketRequired.)
Public eventWritingProgressChangedOccurs when the XpsDocumentWriter updates its progress. (Overrides SerializerWriter.WritingProgressChanged.)
Top

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.

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


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

            XpsDocumentWriter xpsdw = XpsDocument.CreateXpsDocumentWriter(_xpsDocument);

.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.

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