Skip to main content
A newer version of this page is available. .

Section.PaperKind Property

Gets the paper size of the section’s pages.

Namespace: DevExpress.Blazor.RichEdit

Assembly: DevExpress.Blazor.RichEdit.v21.2.dll

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

public PaperKind PaperKind { get; }

Property Value

Type Description
PaperKind

A page size.

Remarks

Call the section’s ChangePropertiesAsync method to change the size of the section’s pages.

The example below sets the size of every page in the open document to A4.

<DxRichEdit @ref="richEdit" />

@code {
    DxRichEdit richEdit;
    Document documentAPI;
    @* ... *@
    /* Surround the code that contains an asynchronous operation with a try-catch block to handle
    the OperationCanceledException. This exception is thrown when an asynchronous operation is cancelled. */
        try {
            documentAPI = richEdit.DocumentAPI;
            @* ... *@
            var sections = await documentAPI.Sections.GetAllAsync();
            foreach (Section s in sections)
                await s.ChangePropertiesAsync(properties => {
                    if (s.PaperKind != System.Drawing.Printing.PaperKind.A4)
                        properties.PaperKind = System.Drawing.Printing.PaperKind.A4;
                    });
                    @* ... *@
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
}

Use any of the following properties to define the size of the section’s pages:

PageSize
Allows you to specify a custom height and width. Assign them to the PageSize.Height and PageSize.Width properties. The Rich Text Editor updates the PaperKind property with the matching paper size value or sets the PaperKind property to Custom.
PaperKind
Allows you to match the page size to one of the standard paper sizes. Assign a paper size (a value other than Custom) to the PaperKind property. The Rich Text Editor updates the PageSize settings with matching height and width values.
See Also