FixedDocument.DocumentPaginator Property

 

Gets the paginator for the FixedDocument that provides page-oriented services such as getting a particular page and repaginating in response to changes.

Namespace:   System.Windows.Documents
Assembly:  PresentationFramework (in PresentationFramework.dll)

public DocumentPaginator DocumentPaginator { get; }

Property Value

Type: System.Windows.Documents.DocumentPaginator

An object of a class derived from DocumentPaginator that provides pagination services.

If you need a paginator with automatic repagination in responses to changes, such as adding content to the document, derive a class from DynamicDocumentPaginator which itself inherits from DocumentPaginator.

The following example shows how to create a FixedDocument that has a paginator configured for a particular page size.

// ------------------------ 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;
}

The following example also shows use of the DocumentPaginator property.

// ------------------------ 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;
}

.NET Framework
Available since 3.0
Return to top
Show: