VisualsToXpsDocument Class
Provides methods for writing Visual objects to XML Paper Specification (XPS) documents or to a print queue in batch mode.
System.Windows.Documents.Serialization.SerializerWriterCollator
System.Windows.Xps.VisualsToXpsDocument
Namespace: System.Windows.Xps
Assembly: System.Printing (in System.Printing.dll)
The VisualsToXpsDocument type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | BeginBatchWrite | Indicates that write operations can begin. (Overrides SerializerWriterCollator.BeginBatchWrite().) |
![]() | Cancel | Cancels a synchronous writing operation. (Overrides SerializerWriterCollator.Cancel().) |
![]() | CancelAsync | Cancels an asynchronous writing operation. (Overrides SerializerWriterCollator.CancelAsync().) |
![]() | EndBatchWrite | Indicates that write operations must end. (Overrides SerializerWriterCollator.EndBatchWrite().) |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() | Write(Visual) | Writes a Visual synchronously to an XpsDocument or a PrintQueue. (Overrides SerializerWriterCollator.Write(Visual).) |
![]() | Write(Visual, PrintTicket) | Writes a Visual synchronously to an XpsDocument or a PrintQueue and includes a PrintTicket. (Overrides SerializerWriterCollator.Write(Visual, PrintTicket).) |
![]() | WriteAsync(Visual) | Writes a Visual asynchronously to an XpsDocument or a PrintQueue. (Overrides SerializerWriterCollator.WriteAsync(Visual).) |
![]() | WriteAsync(Visual, Object) | Writes a Visual asynchronously to an XpsDocument or a PrintQueue and includes additional information that the caller wants to pass to an event handler. (Overrides SerializerWriterCollator.WriteAsync(Visual, Object).) |
![]() | WriteAsync(Visual, PrintTicket) | Writes a Visual asynchronously to an XpsDocument or a PrintQueue and includes a PrintTicket. (Overrides SerializerWriterCollator.WriteAsync(Visual, PrintTicket).) |
![]() | WriteAsync(Visual, PrintTicket, Object) | Writes a Visual asynchronously to an XpsDocument or a PrintQueue; also includes a PrintTicket and any additional information that the caller wants to pass to an event handler. (Overrides SerializerWriterCollator.WriteAsync(Visual, PrintTicket, Object).) |
Because this class has no constructor, use the CreateVisualsCollator method to create an instance.
The VisualsToXpsDocument writes to the same target XpsDocument or PrintQueue as the XpsDocumentWriter that creates the VisualsToXpsDocument.
Each Visual becomes a page in the document.
The following example shows how to create a visuals collator and use it to write to an XML Paper Specification (XPS) document.
private void SaveVisuals(XpsDocumentWriter xpsdw, List<Visual> vc) { // Setup for writing multiple visuals VisualsToXpsDocument vToXpsD = (VisualsToXpsDocument)xpsdw.CreateVisualsCollator(); // Iterate through all visuals in the collection foreach (Visual v in vc) { vToXpsD.Write(v); //Write each visual to single page } // End writing multiple visuals vToXpsD.EndBatchWrite(); }
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.
