VisualsToXpsDocument Class

VisualsToXpsDocument Class

 

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

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


public class VisualsToXpsDocument : SerializerWriterCollator

NameDescription
System_CAPS_pubmethodBeginBatchWrite()

Indicates that write operations can begin.(Overrides SerializerWriterCollator.BeginBatchWrite().)

System_CAPS_pubmethodCancel()

Cancels a synchronous writing operation.(Overrides SerializerWriterCollator.Cancel().)

System_CAPS_pubmethodCancelAsync()

Cancels an asynchronous writing operation.(Overrides SerializerWriterCollator.CancelAsync().)

System_CAPS_pubmethodEndBatchWrite()

Indicates that write operations must end.(Overrides SerializerWriterCollator.EndBatchWrite().)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubmethodWrite(Visual)

Writes a Visualsynchronously to an XpsDocument or a PrintQueue.(Overrides SerializerWriterCollator.Write(Visual).)

System_CAPS_pubmethodWrite(Visual, PrintTicket)

Writes a Visualsynchronously to an XpsDocument or a PrintQueue and includes a PrintTicket.(Overrides SerializerWriterCollator.Write(Visual, PrintTicket).)

System_CAPS_pubmethodWriteAsync(Visual)

Writes a Visualasynchronously to an XpsDocument or a PrintQueue.(Overrides SerializerWriterCollator.WriteAsync(Visual).)

System_CAPS_pubmethodWriteAsync(Visual, Object)

Writes a Visualasynchronously 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).)

System_CAPS_pubmethodWriteAsync(Visual, PrintTicket)

Writes a Visualasynchronously to an XpsDocument or a PrintQueue and includes a PrintTicket.(Overrides SerializerWriterCollator.WriteAsync(Visual, PrintTicket).)

System_CAPS_pubmethodWriteAsync(Visual, PrintTicket, Object)

Writes a Visualasynchronously 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();
}

.NET Framework
Available since 3.0

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

Return to top
Show:
© 2016 Microsoft