SerializerWriter.CreateVisualsCollator Method (PrintTicket, PrintTicket)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

When overridden in a derived class, returns a SerializerWriterCollator that writes collated Visual elements together with the given print tickets.

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

Public MustOverride Function CreateVisualsCollator (
	documentSequencePT As PrintTicket,
	documentPT As PrintTicket
) As SerializerWriterCollator

Parameters

documentSequencePT
Type: System.Printing.PrintTicket

The default print preferences for FixedDocumentSequence content.

documentPT
Type: System.Printing.PrintTicket

The default print preferences for FixedDocument content.

Return Value

Type: System.Windows.Documents.Serialization.SerializerWriterCollator

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

documentSequencePT or documentPT can be null 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 PrintQueue.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 the use of the CreateVisualsCollator method.

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

.NET Framework
Available since 3.0
Return to top
Show: