VisualsToXpsDocument VisualsToXpsDocument VisualsToXpsDocument VisualsToXpsDocument Class

Definition

Provides methods for writing Visual objects to XML Paper Specification (XPS) documents or to a print queue in batch mode.

public ref class VisualsToXpsDocument : System::Windows::Documents::Serialization::SerializerWriterCollator
public class VisualsToXpsDocument : System.Windows.Documents.Serialization.SerializerWriterCollator
type VisualsToXpsDocument = class
    inherit SerializerWriterCollator
Public Class VisualsToXpsDocument
Inherits SerializerWriterCollator
Inheritance
VisualsToXpsDocumentVisualsToXpsDocumentVisualsToXpsDocumentVisualsToXpsDocument

Examples

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();
}
Private Sub SaveVisuals(ByVal xpsdw As XpsDocumentWriter, ByVal vc As List(Of Visual))
    ' Setup for writing multiple visuals
    Dim vToXpsD As VisualsToXpsDocument = CType(xpsdw.CreateVisualsCollator(), VisualsToXpsDocument)

    ' Iterate through all visuals in the collection
    For Each v As Visual In vc
        vToXpsD.Write(v) 'Write each visual to single page
    Next v

    ' End writing multiple visuals
    vToXpsD.EndBatchWrite()
End Sub

Remarks

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.

Methods

BeginBatchWrite() BeginBatchWrite() BeginBatchWrite() BeginBatchWrite()

Indicates that write operations can begin.

Cancel() Cancel() Cancel() Cancel()

Cancels a synchronous writing operation.

CancelAsync() CancelAsync() CancelAsync() CancelAsync()

Cancels an asynchronous writing operation.

EndBatchWrite() EndBatchWrite() EndBatchWrite() EndBatchWrite()

Indicates that write operations must end.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
Write(Visual) Write(Visual) Write(Visual) Write(Visual)

Writes a Visual synchronously to an XpsDocument or a PrintQueue.

Write(Visual, PrintTicket) Write(Visual, PrintTicket) Write(Visual, PrintTicket) Write(Visual, PrintTicket)

Writes a Visual synchronously to an XpsDocument or a PrintQueue and includes a PrintTicket.

WriteAsync(Visual) WriteAsync(Visual) WriteAsync(Visual) WriteAsync(Visual)

Writes a Visual asynchronously to an XpsDocument or a PrintQueue.

WriteAsync(Visual, Object) WriteAsync(Visual, Object) WriteAsync(Visual, Object) 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.

WriteAsync(Visual, PrintTicket) WriteAsync(Visual, PrintTicket) WriteAsync(Visual, PrintTicket) WriteAsync(Visual, PrintTicket)

Writes a Visual asynchronously to an XpsDocument or a PrintQueue and includes a PrintTicket.

WriteAsync(Visual, PrintTicket, Object) WriteAsync(Visual, PrintTicket, Object) WriteAsync(Visual, PrintTicket, Object) 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.

Applies to