XpsDocumentWriter.CreateVisualsCollator 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回一个可将 VisualsToXpsDocument 对象写入文档或打印队列中的 Visual。
重载
CreateVisualsCollator() |
返回一个可将 VisualsToXpsDocument 对象写入文档或打印队列中的 Visual。 |
CreateVisualsCollator(PrintTicket, PrintTicket) |
返回一个可将具有 VisualsToXpsDocument 设置的 Visual 对象写入 XPS 文档或打印队列中的 PrintTicket。 |
示例
下面的示例显示如何使用 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到同一目标XpsDocument或PrintQueueXpsDocumentWriter创建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
返回
示例
下面的示例显示如何使用 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到同一目标XpsDocument或PrintQueueXpsDocumentWriter创建VisualsToXpsDocument的目标 。
适用于
CreateVisualsCollator(PrintTicket, PrintTicket)
返回一个可将具有 VisualsToXpsDocument 设置的 Visual 对象写入 XPS 文档或打印队列中的 PrintTicket。
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。
- documentPrintTicket
- PrintTicket
一个表示每个文档的默认打印首选项的 PrintTicket。
返回
将具有 VisualsToXpsDocument 设置的 Visual 元素写入 PrintTicket 中的新 XpsDocument。
注解
写入VisualsToXpsDocument到同一目标XpsDocument或PrintQueueXpsDocumentWriter创建VisualsToXpsDocument的目标 。
此方法不会验证或修改为特定PrintQueue指定的documentPrintTicket
值。 如有必要,请使用该方法 MergeAndValidatePrintTicket 创建一个 PrintTicket 特定于 PrintQueue 指定打印机且有效的打印机。