Page Setup Dialog in Rich Text Editor for WPF
- 3 minutes to read
In the Page Setup dialog, end users can specify the document margins, orientation, paper size, layout and apply the changes to a whole document or an individual section.
Use the Page Setup dialog box launcher on the Page Layout ribbon tab to invoke this dialog. Refer to the topic for details on how to add the ribbon UI for the RichEditControl:Create a Simple Rich Text Editor. The ShowPageSetupFormCommand command execution invokes this dialog as well.
All page settings are combined under the following tabs:
Margins
Options under the Margins tab enable users to set the margins and the orientation of the document pages.
The following API allows you to specify Margins options in code:
Option | Description | API Member |
---|---|---|
Margins (Top, Left, Bottom, Right) | Specify page margins. | Section.Margins |
Gutter | Adds a gutter margin - an extra space that ensures that binding will not obscure the text on printed pages. | SectionMargins.Gutter |
Gutter Position | Allows you to position a gutter margin at page left or right. This gutter is applied to a specific section. | SectionMargins.GutterPosition |
Orientation | Allows you to change the page orientation | SectionPage.Landscape |
Multiple Pages | Specifies whether the margins are mirrored for multiple pages. | Document.MarginType |
Paper
The Paper tab includes options that allow users to specify paper size used in a document printout.
Option | Description | API Member |
---|---|---|
Paper Size | Changes the paper size. | SectionPage.PaperKind |
Width | Specifies the page width. | SectionPage.Width |
Height | Specifies the page height. | SectionPage.Height |
Layout
Options on the Layout tab of the Page Setup dialog enable users to set when to start the current section and change the edit mode of headers and footers of a document.
Option | Description | API Member |
---|---|---|
Section start | Specifies where the next section starts. | Section.StartType |
Suppress endnotes | Suppresses endnotes for the current section. Available if endnotes are located at the end of each section. | EndnoteOptions.Suppress |
Different odd and even | Enables different page settings for odd and even pages. | Document.DifferentOddAndEvenPages |
Different first page | Enables different header and footer options for the first document page. | Section.DifferentFirstPage |
From edge | Specify the distance between the header/footer and the top/bottom of the page. | SectionMargins.FooterOffset SectionMargins.HeaderOffset |
The Apply to option that is located on each tab of the Page Setup dialog allows users to specify whether the changes should be applied to the whole document or current section only.
Note
Set the Document.Unit property to specify units of measure to be used in the Page Setup dialog.