Back to Devexpress

Page Setup Dialog in Rich Text Editor for WPF

wpf-10397-controls-and-libraries-rich-text-editor-visual-elements-dialogs-page-setup-dialog.md

latest5.0 KB
Original Source

Page Setup Dialog in Rich Text Editor for WPF

  • Mar 11, 2024
  • 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:

OptionDescriptionAPI Member
Margins (Top, Left, Bottom, Right)Specify page margins.Section.Margins
GutterAdds a gutter margin - an extra space that ensures that binding will not obscure the text on printed pages.SectionMargins.Gutter
Gutter PositionAllows you to position a gutter margin at page left or right. This gutter is applied to a specific section.SectionMargins.GutterPosition
OrientationAllows you to change the page orientationSectionPage.Landscape
Multiple PagesSpecifies 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.

OptionDescriptionAPI Member
Paper SizeChanges the paper size.SectionPage.PaperKind
WidthSpecifies the page width.SectionPage.Width
HeightSpecifies 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.

OptionDescriptionAPI Member
Section startSpecifies where the next section starts.Section.StartType
Suppress endnotesSuppresses endnotes for the current section. Available if endnotes are located at the end of each section.EndnoteOptions.Suppress
Different odd and evenEnables different page settings for odd and even pages.Document.DifferentOddAndEvenPages
Different first pageEnables different header and footer options for the first document page.Section.DifferentFirstPage
From edgeSpecify 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.

See Also

How to: Configure the Page Layout Programmatically