VisualsToXpsDocument.Write 方法

定义

Visual 同步写入 XpsDocumentPrintQueue

重载

Write(Visual)

Visual 同步写入 XpsDocumentPrintQueue

Write(Visual, PrintTicket)

Visual 同步写入 XpsDocumentPrintQueue 并包含 PrintTicket

Write(Visual)

Visual 同步写入 XpsDocumentPrintQueue

public:
 override void Write(System::Windows::Media::Visual ^ visual);
public override void Write (System.Windows.Media.Visual visual);
override this.Write : System.Windows.Media.Visual -> unit
Public Overrides Sub Write (visual As Visual)

参数

visual
Visual

写入的 Visual

示例

以下示例演示如何使用此方法写入 XML 纸张规范 (XPS) 文档。

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

适用于

Write(Visual, PrintTicket)

Visual 同步写入 XpsDocumentPrintQueue 并包含 PrintTicket

public:
 override void Write(System::Windows::Media::Visual ^ visual, System::Printing::PrintTicket ^ printTicket);
public override void Write (System.Windows.Media.Visual visual, System.Printing.PrintTicket printTicket);
override this.Write : System.Windows.Media.Visual * System.Printing.PrintTicket -> unit
Public Overrides Sub Write (visual As Visual, printTicket As PrintTicket)

参数

visual
Visual

写入的 Visual

printTicket
PrintTicket

一个 PrintTicket,它表示文档的默认打印首选项。

注解

此方法不会验证或修改为特定PrintQueue指定的printTicket值。 如有必要,请使用该方法 MergeAndValidatePrintTicket 创建 PrintTicket 特定于 PrintQueue 指定的打印机且对指定的打印机有效。

适用于