共用方式為


XpsDocumentWriter.CreateVisualsCollator 方法

定義

傳回可將 VisualsToXpsDocument 物件寫入文件或列印佇列的 Visual

多載

CreateVisualsCollator()

傳回可將 VisualsToXpsDocument 物件寫入文件或列印佇列的 Visual

CreateVisualsCollator(PrintTicket, PrintTicket)

傳回 VisualsToXpsDocument,它可以將具有 Visual 設定的 PrintTicket 物件寫入至 XPS 文件或列印佇列。

範例

下列範例會示範如何使用 CreateVisualsCollator 方法。

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

備註

寫入 VisualsToXpsDocument 至相同目標 XpsDocumentPrintQueue XpsDocumentWriter 建立 的 VisualsToXpsDocument

CreateVisualsCollator()

傳回可將 VisualsToXpsDocument 物件寫入文件或列印佇列的 Visual

public:
 override System::Windows::Documents::Serialization::SerializerWriterCollator ^ CreateVisualsCollator();
public override System.Windows.Documents.Serialization.SerializerWriterCollator CreateVisualsCollator ();
override this.CreateVisualsCollator : unit -> System.Windows.Documents.Serialization.SerializerWriterCollator
Public Overrides Function CreateVisualsCollator () As SerializerWriterCollator

傳回

SerializerWriterCollator

新的 VisualsToXpsDocument

範例

下列範例會示範如何使用 CreateVisualsCollator 方法。

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

備註

寫入 VisualsToXpsDocument 至相同目標 XpsDocumentPrintQueue XpsDocumentWriter 建立 的 VisualsToXpsDocument

適用於

CreateVisualsCollator(PrintTicket, PrintTicket)

傳回 VisualsToXpsDocument,它可以將具有 Visual 設定的 PrintTicket 物件寫入至 XPS 文件或列印佇列。

public:
 override System::Windows::Documents::Serialization::SerializerWriterCollator ^ CreateVisualsCollator(System::Printing::PrintTicket ^ documentSequencePrintTicket, System::Printing::PrintTicket ^ documentPrintTicket);
public override System.Windows.Documents.Serialization.SerializerWriterCollator CreateVisualsCollator (System.Printing.PrintTicket documentSequencePrintTicket, System.Printing.PrintTicket documentPrintTicket);
override this.CreateVisualsCollator : System.Printing.PrintTicket * System.Printing.PrintTicket -> System.Windows.Documents.Serialization.SerializerWriterCollator
Public Overrides Function CreateVisualsCollator (documentSequencePrintTicket As PrintTicket, documentPrintTicket As PrintTicket) As SerializerWriterCollator

參數

documentSequencePrintTicket
PrintTicket

PrintTicket,指定文件序列 (Sequence) 的預設列印偏好設定。

documentPrintTicket
PrintTicket

PrintTicket,表示每個文件的預設列印偏好設定。

傳回

SerializerWriterCollator

新的 VisualsToXpsDocument,可將具有 Visual 設定的 PrintTicket 項目寫入至 XpsDocument

備註

寫入 VisualsToXpsDocument 至相同目標 XpsDocumentPrintQueue XpsDocumentWriter 建立 的 VisualsToXpsDocument

這個方法不會驗證或修改為特定 PrintQueue 指定的 documentPrintTicket 。 如有必要,請使用 MergeAndValidatePrintTicket 方法來建立 PrintTicket 指定印表機的特定 PrintQueue 和 有效 。

適用於