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.

SerializerWriter.CreateVisualsCollator Method (PrintTicket, PrintTicket)

When overridden in a derived class, returns a SerializerWriterCollator that writes collated Visual elements together with an associated given print ticket.

Namespace: System.Windows.Documents.Serialization
Assembly: PresentationFramework (in presentationframework.dll)

public abstract SerializerWriterCollator CreateVisualsCollator (
	PrintTicket documentSequencePT,
	PrintTicket documentPT
)
public abstract SerializerWriterCollator CreateVisualsCollator (
	PrintTicket documentSequencePT, 
	PrintTicket documentPT
)
public abstract function CreateVisualsCollator (
	documentSequencePT : PrintTicket, 
	documentPT : PrintTicket
) : SerializerWriterCollator
You cannot use methods in XAML.

Parameters

documentSequencePT

The default print preferences for FixedDocumentSequence content.

documentPT

The default print preferences for FixedDocument content.

Return Value

A SerializerWriterCollator that writes collated Visual elements to the document output serialization Stream.

documentSequencePT or documentPT can be a null reference (Nothing in Visual Basic) if there are no preferred print settings.

This method does not validate or modify the given print tickets for a particular PrintQueue. If needed, use the MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given printer.

Notes to Implementers: CreateVisualsCollator should return a SerializerWriterCollator that writes to the same serialization Stream as the SerializerWriter that creates it.

The following example shows use of the CreateVisualsCollator method. For the complete sample, see the Saving an XPS Document Sample.

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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2015 Microsoft