# RtfPageSetup

Page size and margin settings for an RTF document.

Class 

`OfficeIMO.Rtf`

**Namespace**

`OfficeIMO.Rtf`

**Assembly**

`OfficeIMO.Rtf`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[RtfPageSetup.cs:59](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L59)

**Implements**

`IRtfCloneable`

**Modifiers**

sealed

Page size and margin settings for an RTF document.

## Inheritance

- object
- RtfPageSetup

## Usage

Explore 11 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 11

- Method [RtfDocument.GetEffectivePageSetup](/api/rtf/officeimo-rtf-rtfdocument/#method-geteffectivepagesetup-officeimo-rtf-rtfsection)
- Property [RtfDocument.PageSetup](/api/rtf/officeimo-rtf-rtfdocument/#property-pagesetup)
- Method [RtfPageSetup.SetDifferentFirstPageHeaderFooter](/api/rtf/officeimo-rtf-rtfpagesetup/#method-setdifferentfirstpageheaderfooter-boolean)
- Method [RtfPageSetup.SetGutter](/api/rtf/officeimo-rtf-rtfpagesetup/#method-setgutter-nullable-system-int32-boolean)
- Method [RtfPageSetup.SetHeaderFooterDistance](/api/rtf/officeimo-rtf-rtfpagesetup/#method-setheaderfooterdistance-nullable-system-int32-nullable-system-int32)
- Method [RtfPageSetup.SetLandscape](/api/rtf/officeimo-rtf-rtfpagesetup/#method-setlandscape-boolean)
- Method [RtfPageSetup.SetMargins](/api/rtf/officeimo-rtf-rtfpagesetup/#method-setmargins-nullable-system-int32-nullable-system-int32-nullable-system-int32-nullable-system-int32)
- Method [RtfPageSetup.SetPageNumbering](/api/rtf/officeimo-rtf-rtfpagesetup/#method-setpagenumbering-nullable-system-int32-nullable-system-boolean-nullable-officeimo-rtf-rtfpagenumberformat-nullable-system-int32-nullable-system-int32)
- Method [RtfPageSetup.SetPaperSize](/api/rtf/officeimo-rtf-rtfpagesetup/#method-setpapersize-int32-int32)
- Method [RtfPageSetup.SetPrinterPaper](/api/rtf/officeimo-rtf-rtfpagesetup/#method-setprinterpaper-nullable-system-int32-nullable-system-int32-nullable-system-int32)
- Property [RtfSection.PageSetup](/api/rtf/officeimo-rtf-rtfsection/#property-pagesetup)

Filter members 

Show inherited

## Constructors

`public RtfPageSetup()` [#](#constructor-ctor)

[RtfPageSetup.cs:59](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L59)

## Methods

`public RtfPageSetup SetDifferentFirstPageHeaderFooter(bool enabled = true)` [#](#method-setdifferentfirstpageheaderfooter-boolean)

[RtfPageSetup.cs:155](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L155)

Sets whether first-page header/footer variants should be enabled.

Parameters

**enabled bool = true optional**

Returns

`RtfPageSetup`

`public RtfPageSetup SetGutter(int? gutterWidthTwips = null, bool rtlGutter = false)` [#](#method-setgutter-nullable-system-int32-boolean)

[RtfPageSetup.cs:101](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L101)

Sets gutter width in twips.

Parameters

**gutterWidthTwips int? = null optional**

**rtlGutter bool = false optional**

Returns

`RtfPageSetup`

`public RtfPageSetup SetHeaderFooterDistance(int? headerDistanceTwips = null, int? footerDistanceTwips = null)` [#](#method-setheaderfooterdistance-nullable-system-int32-nullable-system-int32)

[RtfPageSetup.cs:109](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L109)

Sets header and footer distances from the page edges in twips.

Parameters

**headerDistanceTwips int? = null optional**

**footerDistanceTwips int? = null optional**

Returns

`RtfPageSetup`

`public RtfPageSetup SetLandscape(bool landscape = true)` [#](#method-setlandscape-boolean)

[RtfPageSetup.cs:149](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L149)

Sets whether landscape orientation should be emitted.

Parameters

**landscape bool = true optional**

Returns

`RtfPageSetup`

`public RtfPageSetup SetMargins(int? leftTwips = null, int? rightTwips = null, int? topTwips = null, int? bottomTwips = null)` [#](#method-setmargins-nullable-system-int32-nullable-system-int32-nullable-system-int32-nullable-system-int32)

[RtfPageSetup.cs:136](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L136)

Sets document margins in twips.

Parameters

**leftTwips int? = null optional**

**rightTwips int? = null optional**

**topTwips int? = null optional**

**bottomTwips int? = null optional**

Returns

`RtfPageSetup`

`public RtfPageSetup SetPageNumbering(int? start = null, bool? restart = null, RtfPageNumberFormat? format = null, int? positionXTwips = null, int? positionYTwips = null)` [#](#method-setpagenumbering-nullable-system-int32-nullable-system-boolean-nullable-officeimo-rtf-rtfpagenumberformat-nullable-system-int32-nullable-system-int32)

[RtfPageSetup.cs:123](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L123)

Sets page numbering controls.

Parameters

**start int? = null optional**

**restart bool? = null optional**

**format OfficeIMO.Rtf.RtfPageNumberFormat? = null optional**

**positionXTwips int? = null optional**

**positionYTwips int? = null optional**

Returns

`RtfPageSetup`

`public RtfPageSetup SetPaperSize(int widthTwips, int heightTwips)` [#](#method-setpapersize-int32-int32)

[RtfPageSetup.cs:81](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L81)

Sets paper size in twips.

Parameters

**widthTwips int required**

**heightTwips int required**

Returns

`RtfPageSetup`

`public RtfPageSetup SetPrinterPaper(int? paperSize = null, int? firstPageSource = null, int? otherPagesSource = null)` [#](#method-setprinterpaper-nullable-system-int32-nullable-system-int32-nullable-system-int32)

[RtfPageSetup.cs:90](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L90)

Sets printer-specific paper metadata.

Parameters

**paperSize int? = null optional**

**firstPageSource int? = null optional**

**otherPagesSource int? = null optional**

Returns

`RtfPageSetup`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public int? PaperWidthTwips { get; set; }` [#](#property-paperwidthtwips)

[RtfPageSetup.cs:8](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L8)

Paper width in twips.

`public int? PaperHeightTwips { get; set; }` [#](#property-paperheighttwips)

[RtfPageSetup.cs:11](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L11)

Paper height in twips.

`public int? PrinterPaperSize { get; set; }` [#](#property-printerpapersize)

[RtfPageSetup.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L14)

Printer paper size code represented by \psz.

`public int? FirstPagePaperSource { get; set; }` [#](#property-firstpagepapersource)

[RtfPageSetup.cs:17](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L17)

Printer bin source for the first page represented by \binfsxn.

`public int? OtherPagesPaperSource { get; set; }` [#](#property-otherpagespapersource)

[RtfPageSetup.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L20)

Printer bin source for subsequent pages represented by \binsxn.

`public int? MarginLeftTwips { get; set; }` [#](#property-marginlefttwips)

[RtfPageSetup.cs:23](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L23)

Left margin in twips.

`public int? MarginRightTwips { get; set; }` [#](#property-marginrighttwips)

[RtfPageSetup.cs:26](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L26)

Right margin in twips.

`public int? MarginTopTwips { get; set; }` [#](#property-margintoptwips)

[RtfPageSetup.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L29)

Top margin in twips.

`public int? MarginBottomTwips { get; set; }` [#](#property-marginbottomtwips)

[RtfPageSetup.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L32)

Bottom margin in twips.

`public int? GutterWidthTwips { get; set; }` [#](#property-gutterwidthtwips)

[RtfPageSetup.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L35)

Gutter width in twips.

`public int? HeaderDistanceTwips { get; set; }` [#](#property-headerdistancetwips)

[RtfPageSetup.cs:38](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L38)

Header distance from the top edge of the page in twips.

`public int? FooterDistanceTwips { get; set; }` [#](#property-footerdistancetwips)

[RtfPageSetup.cs:41](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L41)

Footer distance from the bottom edge of the page in twips.

`public int? PageNumberStart { get; set; }` [#](#property-pagenumberstart)

[RtfPageSetup.cs:44](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L44)

Beginning page number.

`public bool? PageNumberRestart { get; set; }` [#](#property-pagenumberrestart)

[RtfPageSetup.cs:47](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L47)

Whether page numbering restarts in this page setup. false represents continuous numbering.

`public int? PageNumberPositionXTwips { get; set; }` [#](#property-pagenumberpositionxtwips)

[RtfPageSetup.cs:50](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L50)

Horizontal page-number position in twips from the right margin.

`public int? PageNumberPositionYTwips { get; set; }` [#](#property-pagenumberpositionytwips)

[RtfPageSetup.cs:53](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L53)

Vertical page-number position in twips from the top margin.

`public RtfPageNumberFormat? PageNumberFormat { get; set; }` [#](#property-pagenumberformat)

[RtfPageSetup.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L56)

Page-number display format.

`public RtfPageBorders PageBorders { get; private set; }` [#](#property-pageborders)

[RtfPageSetup.cs:59](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L59)

Page border settings.

`public bool Landscape { get; set; }` [#](#property-landscape)

[RtfPageSetup.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L62)

Whether the document declares landscape orientation.

`public bool? DirectLandscape { get; set; }` [#](#property-directlandscape)

[RtfPageSetup.cs:65](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L65)

Authored orientation. Null inherits the document's orientation; false explicitly selects portrait.

`public bool DifferentFirstPageHeaderFooter { get; set; }` [#](#property-differentfirstpageheaderfooter)

[RtfPageSetup.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L68)

Whether first-page header/footer variants are enabled, represented by \titlepg.

`public bool? DirectDifferentFirstPageHeaderFooter { get; set; }` [#](#property-directdifferentfirstpageheaderfooter)

[RtfPageSetup.cs:71](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L71)

Authored first-page header/footer setting. Null inherits the document setting.

`public bool RtlGutter { get; set; }` [#](#property-rtlgutter)

[RtfPageSetup.cs:74](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L74)

Whether the gutter should be positioned on the right side.

`public bool? DirectRtlGutter { get; set; }` [#](#property-directrtlgutter)

[RtfPageSetup.cs:77](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfPageSetup.cs#L77)

Authored gutter direction. Null inherits the document setting.

<!-- PowerForge markdown artifact sha256:4CF8E8F35555180D329F579E58E0D92646C6342C612750D32B6675A3849BF3E6 -->
