PrintQueue.CreateXpsDocumentWriter 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
创建 对象 XpsDocumentWriter 。
重载
| 名称 | 说明 |
|---|---|
| CreateXpsDocumentWriter(PrintDocumentImageableArea, PageRangeSelection, PageRange) |
创建对象 XpsDocumentWriter ,打开 Windows 通用打印对话框,为对话框提供页面范围和打印作业的说明,并返回一个 |
| CreateXpsDocumentWriter(PrintDocumentImageableArea) |
创建一个 XpsDocumentWriter 对象,打开一个 Windows 通用打印对话框,并返回一个 |
| CreateXpsDocumentWriter(PrintQueue) |
创建一个 XpsDocumentWriter 对象并将其与指定的打印队列相关联。 |
| CreateXpsDocumentWriter(Double, Double) |
XpsDocumentWriter创建具有指定维度的对象。 |
| CreateXpsDocumentWriter(String, PrintDocumentImageableArea) |
创建一个 XpsDocumentWriter 对象,打开一个 Windows 通用打印对话框(并为其提供作业说明),并返回一个 |
| CreateXpsDocumentWriter(String, PrintDocumentImageableArea, PageRangeSelection, PageRange) |
创建一个对象,打开一个 XpsDocumentWriter Windows 通用打印对话框,提供一个页面范围对话框,并返回一个 |
CreateXpsDocumentWriter(PrintDocumentImageableArea, PageRangeSelection, PageRange)
创建对象 XpsDocumentWriter ,打开 Windows 通用打印对话框,为对话框提供页面范围和打印作业的说明,并返回一个 ref (ByRef 在 Visual Basic 中)参数,该参数表示有关可图像区域和媒体尺寸的信息。
public:
static System::Windows::Xps::XpsDocumentWriter ^ CreateXpsDocumentWriter(System::Printing::PrintDocumentImageableArea ^ % documentImageableArea, System::Windows::Controls::PageRangeSelection % pageRangeSelection, System::Windows::Controls::PageRange % pageRange);
[System.Security.SecurityCritical]
public static System.Windows.Xps.XpsDocumentWriter CreateXpsDocumentWriter(ref System.Printing.PrintDocumentImageableArea documentImageableArea, ref System.Windows.Controls.PageRangeSelection pageRangeSelection, ref System.Windows.Controls.PageRange pageRange);
public static System.Windows.Xps.XpsDocumentWriter CreateXpsDocumentWriter(ref System.Printing.PrintDocumentImageableArea documentImageableArea, ref System.Windows.Controls.PageRangeSelection pageRangeSelection, ref System.Windows.Controls.PageRange pageRange);
[<System.Security.SecurityCritical>]
static member CreateXpsDocumentWriter : PrintDocumentImageableArea * PageRangeSelection * PageRange -> System.Windows.Xps.XpsDocumentWriter
static member CreateXpsDocumentWriter : PrintDocumentImageableArea * PageRangeSelection * PageRange -> System.Windows.Xps.XpsDocumentWriter
Public Shared Function CreateXpsDocumentWriter (ByRef documentImageableArea As PrintDocumentImageableArea, ByRef pageRangeSelection As PageRangeSelection, ByRef pageRange As PageRange) As XpsDocumentWriter
参数
- documentImageableArea
- PrintDocumentImageableArea
对包含设备可打印的页面区域尺寸的对象的引用。 由于其数据类型没有公共构造函数,因此未初始化此参数。
- pageRangeSelection
- PageRangeSelection
一个值,该值指定是打印所有页面还是仅打印用户指定的范围。
- pageRange
- PageRange
打印的页面范围。
返回
XpsDocumentWriter将 XPS 数据写入流。 它可以是 null。 (参数documentImageableArea和pageRangeSelectionpageRange所有 ref [ByRef在 Visual Basic] 参数中由用户初始化,并在对话框关闭时返回,因此每个参数都表示其他返回的项。
- 属性
注解
许多打印机需要每页边缘周围四分之一英寸的未打印空间,以控制纸张并通过打印机移动它。 否则,调纸将犯规纸张流机制。 可以打印的区域是“可图像区域”。
该类型 PrintDocumentImageableArea 没有公共构造函数。 因此,必须将变量声明并分配给null该变量documentImageableArea,然后才传递给该方法。 此方法显示 PrintDialog 用户所需的输入。 用户在对话框中配置打印作业(包括选择打印机、纸张大小、方向和页面范围)。 关闭对话框 pageRangeSelection 并 pageRange 具有值,并 documentImageableArea 指向初始化其属性的实际对象。
如果用户取消或关闭对话框,则返回值为 null。 因此,应用程序必须检查 null 返回值。
适用于
CreateXpsDocumentWriter(PrintDocumentImageableArea)
创建一个 XpsDocumentWriter 对象,打开一个 Windows 通用打印对话框,并返回一个 ref (ByRef 在 Visual Basic 中)参数,该参数表示有关可图像区域和媒体尺寸的信息。
public:
static System::Windows::Xps::XpsDocumentWriter ^ CreateXpsDocumentWriter(System::Printing::PrintDocumentImageableArea ^ % documentImageableArea);
[System.Security.SecurityCritical]
public static System.Windows.Xps.XpsDocumentWriter CreateXpsDocumentWriter(ref System.Printing.PrintDocumentImageableArea documentImageableArea);
public static System.Windows.Xps.XpsDocumentWriter CreateXpsDocumentWriter(ref System.Printing.PrintDocumentImageableArea documentImageableArea);
[<System.Security.SecurityCritical>]
static member CreateXpsDocumentWriter : PrintDocumentImageableArea -> System.Windows.Xps.XpsDocumentWriter
static member CreateXpsDocumentWriter : PrintDocumentImageableArea -> System.Windows.Xps.XpsDocumentWriter
Public Shared Function CreateXpsDocumentWriter (ByRef documentImageableArea As PrintDocumentImageableArea) As XpsDocumentWriter
参数
- documentImageableArea
- PrintDocumentImageableArea
对包含设备可打印的页面区域尺寸的对象的引用。 由于其数据类型没有公共构造函数,因此未初始化此参数。
返回
XpsDocumentWriter将 XPS 数据写入流。 它可以是 null。 (该参数 documentImageableArea 是一个 ref [ByRef 在 Visual Basic] 参数中由该方法初始化,因此它表示第二个返回的项。
- 属性
注解
许多打印机需要每页边缘周围四分之一英寸的未打印空间,以控制纸张并通过打印机移动它。 否则,调纸将犯规纸张流机制。 可以打印的区域是“可图像区域”。
该类型 PrintDocumentImageableArea 没有公共构造函数。 因此,必须将变量声明并分配给null该变量documentImageableArea,然后才传递给该方法。 此方法显示 PrintDialog 用户所需的输入。 用户选择打印机、纸张大小和方向并关闭对话框后, documentImageableArea 将指向实际对象及其属性初始化。
如果用户取消或关闭对话框,则返回值为 null。 因此,应用程序必须检查 null 返回值。
适用于
CreateXpsDocumentWriter(PrintQueue)
创建一个 XpsDocumentWriter 对象并将其与指定的打印队列相关联。
public:
static System::Windows::Xps::XpsDocumentWriter ^ CreateXpsDocumentWriter(System::Printing::PrintQueue ^ printQueue);
public static System.Windows.Xps.XpsDocumentWriter CreateXpsDocumentWriter(System.Printing.PrintQueue printQueue);
static member CreateXpsDocumentWriter : System.Printing.PrintQueue -> System.Windows.Xps.XpsDocumentWriter
Public Shared Function CreateXpsDocumentWriter (printQueue As PrintQueue) As XpsDocumentWriter
参数
- printQueue
- PrintQueue
用于打印 XPS 文档的打印队列。
返回
XpsDocumentWriter写入 XPS 流。
示例
以下示例演示如何使用此方法创建 。XpsDocumentWriter
// -------------------- GetPrintXpsDocumentWriter() -------------------
/// <summary>
/// Returns an XpsDocumentWriter for the default print queue.</summary>
/// <returns>
/// An XpsDocumentWriter for the default print queue.</returns>
private XpsDocumentWriter GetPrintXpsDocumentWriter()
{
// Create a local print server
LocalPrintServer ps = new LocalPrintServer();
// Get the default print queue
PrintQueue pq = ps.DefaultPrintQueue;
// Get an XpsDocumentWriter for the default print queue
XpsDocumentWriter xpsdw = PrintQueue.CreateXpsDocumentWriter(pq);
return xpsdw;
}// end:GetPrintXpsDocumentWriter()
' -------------------- GetPrintXpsDocumentWriter() -------------------
''' <summary>
''' Returns an XpsDocumentWriter for the default print queue.</summary>
''' <returns>
''' An XpsDocumentWriter for the default print queue.</returns>
Private Function GetPrintXpsDocumentWriter() As XpsDocumentWriter
' Create a local print server
Dim ps As New LocalPrintServer()
' Get the default print queue
Dim pq As PrintQueue = ps.DefaultPrintQueue
' Get an XpsDocumentWriter for the default print queue
Dim xpsdw As XpsDocumentWriter = PrintQueue.CreateXpsDocumentWriter(pq)
Return xpsdw
End Function ' end:GetPrintXpsDocumentWriter()
适用于
CreateXpsDocumentWriter(Double, Double)
XpsDocumentWriter创建具有指定维度的对象。
public:
static System::Windows::Xps::XpsDocumentWriter ^ CreateXpsDocumentWriter(double % width, double % height);
[System.Security.SecurityCritical]
public static System.Windows.Xps.XpsDocumentWriter CreateXpsDocumentWriter(ref double width, ref double height);
public static System.Windows.Xps.XpsDocumentWriter CreateXpsDocumentWriter(ref double width, ref double height);
[<System.Security.SecurityCritical>]
static member CreateXpsDocumentWriter : double * double -> System.Windows.Xps.XpsDocumentWriter
static member CreateXpsDocumentWriter : double * double -> System.Windows.Xps.XpsDocumentWriter
Public Shared Function CreateXpsDocumentWriter (ByRef width As Double, ByRef height As Double) As XpsDocumentWriter
参数
- width
- Double
XPS 文档的宽度。
- height
- Double
XPS 文档的高度。
返回
XpsDocumentWriter写入 XPS 流。 它可以是 null。
- 属性
注解
此方法显示 PrintDialog 用户所需的输入。 如果用户取消或关闭对话框,则返回值为 null。 因此,应用程序必须检查 null 返回值。
适用于
CreateXpsDocumentWriter(String, PrintDocumentImageableArea)
创建一个 XpsDocumentWriter 对象,打开一个 Windows 通用打印对话框(并为其提供作业说明),并返回一个 ref (ByRef 在 Visual Basic 中)参数,该参数表示有关可图像区域和媒体尺寸的信息。
public:
static System::Windows::Xps::XpsDocumentWriter ^ CreateXpsDocumentWriter(System::String ^ jobDescription, System::Printing::PrintDocumentImageableArea ^ % documentImageableArea);
[System.Security.SecurityCritical]
public static System.Windows.Xps.XpsDocumentWriter CreateXpsDocumentWriter(string jobDescription, ref System.Printing.PrintDocumentImageableArea documentImageableArea);
public static System.Windows.Xps.XpsDocumentWriter CreateXpsDocumentWriter(string jobDescription, ref System.Printing.PrintDocumentImageableArea documentImageableArea);
[<System.Security.SecurityCritical>]
static member CreateXpsDocumentWriter : string * PrintDocumentImageableArea -> System.Windows.Xps.XpsDocumentWriter
static member CreateXpsDocumentWriter : string * PrintDocumentImageableArea -> System.Windows.Xps.XpsDocumentWriter
Public Shared Function CreateXpsDocumentWriter (jobDescription As String, ByRef documentImageableArea As PrintDocumentImageableArea) As XpsDocumentWriter
参数
- jobDescription
- String
打印作业的名称。 它显示在 Windows 打印用户界面中。
- documentImageableArea
- PrintDocumentImageableArea
对包含设备可打印的页面区域尺寸的对象的引用。 由于其数据类型没有公共构造函数,因此未初始化此参数。
返回
XpsDocumentWriter将 XPS 数据写入流。 它可以是 null。 (该参数 documentImageableArea 是一个 ref [ByRef 在 Visual Basic] 参数中由该方法初始化,因此它表示第二个返回的项。
- 属性
注解
许多打印机需要每页边缘周围四分之一英寸的未打印空间,以控制纸张并通过打印机移动它。 否则,调纸将犯规纸张流机制。 可以打印的区域是“可图像区域”。
该类型 PrintDocumentImageableArea 没有公共构造函数。 因此,必须将变量声明并分配给null该变量documentImageableArea,然后才传递给该方法。 此方法显示 PrintDialog 用户所需的输入。 用户选择打印机、纸张大小和方向并关闭对话框后, documentImageableArea 指向实际对象,并初始化其属性。
如果用户取消或关闭对话框,则返回值为 null。 因此,应用程序必须检查 null 返回值。
适用于
CreateXpsDocumentWriter(String, PrintDocumentImageableArea, PageRangeSelection, PageRange)
创建一个对象,打开一个 XpsDocumentWriter Windows 通用打印对话框,提供一个页面范围对话框,并返回一个 ref (ByRef 在 Visual Basic 中)参数,该参数表示有关可图像区域和媒体尺寸的信息。
public:
static System::Windows::Xps::XpsDocumentWriter ^ CreateXpsDocumentWriter(System::String ^ jobDescription, System::Printing::PrintDocumentImageableArea ^ % documentImageableArea, System::Windows::Controls::PageRangeSelection % pageRangeSelection, System::Windows::Controls::PageRange % pageRange);
[System.Security.SecurityCritical]
public static System.Windows.Xps.XpsDocumentWriter CreateXpsDocumentWriter(string jobDescription, ref System.Printing.PrintDocumentImageableArea documentImageableArea, ref System.Windows.Controls.PageRangeSelection pageRangeSelection, ref System.Windows.Controls.PageRange pageRange);
public static System.Windows.Xps.XpsDocumentWriter CreateXpsDocumentWriter(string jobDescription, ref System.Printing.PrintDocumentImageableArea documentImageableArea, ref System.Windows.Controls.PageRangeSelection pageRangeSelection, ref System.Windows.Controls.PageRange pageRange);
[<System.Security.SecurityCritical>]
static member CreateXpsDocumentWriter : string * PrintDocumentImageableArea * PageRangeSelection * PageRange -> System.Windows.Xps.XpsDocumentWriter
static member CreateXpsDocumentWriter : string * PrintDocumentImageableArea * PageRangeSelection * PageRange -> System.Windows.Xps.XpsDocumentWriter
Public Shared Function CreateXpsDocumentWriter (jobDescription As String, ByRef documentImageableArea As PrintDocumentImageableArea, ByRef pageRangeSelection As PageRangeSelection, ByRef pageRange As PageRange) As XpsDocumentWriter
参数
- jobDescription
- String
打印作业的名称。 它显示在 Windows 打印用户界面中。
- documentImageableArea
- PrintDocumentImageableArea
对包含设备可打印的页面区域尺寸的对象的引用。 由于其数据类型没有公共构造函数,因此未初始化此参数。
- pageRangeSelection
- PageRangeSelection
一个值,该值指定是打印所有页面还是仅打印用户指定的范围。
- pageRange
- PageRange
打印的页面范围。
返回
XpsDocumentWriter将 XPS 数据写入流。 它可以是 null。 (参数documentImageableArea和pageRangeSelectionpageRange所有 ref [ByRef在 Visual Basic] 参数中由用户初始化,并在对话框关闭时返回,因此每个参数都表示其他返回的项。
- 属性
注解
许多打印机需要每页边缘周围四分之一英寸的未打印空间,以控制纸张并通过打印机移动它。 否则,调纸将犯规纸张流机制。 可以打印的区域是“可图像区域”。
该类型 PrintDocumentImageableArea 没有公共构造函数。 因此,必须将变量声明并分配给null该变量documentImageableArea,然后才传递给该方法。 此方法显示 PrintDialog 用户所需的输入。 用户在对话框中配置打印作业(包括选择打印机、纸张大小、方向和页面范围)。 关闭对话框 pageRangeSelection 并 pageRange 具有值,并 documentImageableArea 指向初始化其属性的实际对象。
如果用户取消或关闭对话框,则返回值为 null。 因此,应用程序必须检查 null 返回值。