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
備註
如果您需要具有自動重新編頁的分頁器以回應變更,例如將內容新增至檔,請衍生 DynamicDocumentPaginator 類別,其本身繼承自 DocumentPaginator 。