FixedDocument.DocumentPaginator 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取 FixedDocument 的分页程序,该分页程序提供面向页的服务(如获取特定页及重标页码以响应更改)。
public:
property System::Windows::Documents::DocumentPaginator ^ DocumentPaginator { System::Windows::Documents::DocumentPaginator ^ get(); };
public System.Windows.Documents.DocumentPaginator DocumentPaginator { get; }
member this.DocumentPaginator : System.Windows.Documents.DocumentPaginator
Public ReadOnly Property DocumentPaginator As DocumentPaginator
属性值
一个从提供分页服务的 DocumentPaginator 派生的类的对象。
实现
示例
以下示例演示如何创建 FixedDocument 为特定页面大小配置了分页器的 。
// ------------------------ CreateFixedDocument -----------------------
/// <summary>
/// Creates an empty FixedDocument.</summary>
/// <returns>
/// An empty FixedDocument without any content.</returns>
private FixedDocument CreateFixedDocument()
{
FixedDocument fixedDocument = new FixedDocument();
fixedDocument.DocumentPaginator.PageSize = new Size(96 * 8.5, 96 * 11);
return fixedDocument;
}
' ------------------------ CreateFixedDocument -----------------------
''' <summary>
''' Creates an empty FixedDocument.</summary>
''' <returns>
''' An empty FixedDocument without any content.</returns>
Private Function CreateFixedDocument() As FixedDocument
Dim fixedDocument As New FixedDocument()
fixedDocument.DocumentPaginator.PageSize = New Size(96 * 8.5, 96 * 11)
Return fixedDocument
End Function
以下示例还演示 了 DocumentPaginator 属性的用法。
// ------------------------ CreateFixedDocument -----------------------
/// <summary>
/// Creates an empty FixedDocument.</summary>
/// <returns>
/// An empty FixedDocument without any content.</returns>
private FixedDocument CreateFixedDocument()
{
FixedDocument fixedDocument = new FixedDocument();
fixedDocument.DocumentPaginator.PageSize = new Size(96 * 8.5, 96 * 11);
return fixedDocument;
}
' ------------------------ CreateFixedDocument -----------------------
''' <summary>
''' Creates an empty FixedDocument.</summary>
''' <returns>
''' An empty FixedDocument without any content.</returns>
Private Function CreateFixedDocument() As FixedDocument
Dim fixedDocument As New FixedDocument()
fixedDocument.DocumentPaginator.PageSize = New Size(96 * 8.5, 96 * 11)
Return fixedDocument
End Function
注解
如果需要具有自动重新绘制的分页器以响应更改(例如将内容添加到文档),请派生一个类,该类本身继承自 DynamicDocumentPaginatorDocumentPaginator。