# Page Layout

Learn about Page Layout in PrintDocument from this WinForms documentation helpfile.

## Content



The [PageLayout](/componentone/docs/win/online-printdocument/) class provides the [PageSettings](/componentone/docs/win/online-printdocument/) property to define the page layout for all pages in a PrintDocument. You can also specify a standard paper size using the [PaperKind](/componentone/docs/win/online-printdocument/) property of [C1PageSettings](/componentone/docs/win/online-printdocument/) class.

The GIF image below depicts the use of page layout in document.

![Snapshot of page layout in application.](https://cdn.mescius.io/document-site-files/images/6772f728-508e-4e80-9394-208f07d64beb/images/page-layout.gif)

The code snippet below depicts the use of **C1PageSettings** class to define layout on the first page, even or odd pages in the PrintDocument.

```csharp
// define PageLayout for the first page
PageLayout pl = new PageLayout();
pl.PageSettings = new C1PageSettings();
pl.PageSettings.PaperKind = PaperKind.Legal;
doc.PageLayouts.FirstPage = pl;
// define PageLayout for even pages
pl = new PageLayout();
pl.PageSettings = new C1PageSettings();
pl.PageSettings.PaperKind = PaperKind.Letter;
// create the page header
RenderText ph = new RenderText();
ph.Text = "Even page. [PageNo] / [PageCount]";
ph.Style.Borders.All = LineDef.Default;
ph.Style.BackColor = Color.Beige;
pl.PageHeader = ph;
// even pages will have no page footer, set it to an empty object
pl.PageFooter = new RenderEmpty();
doc.PageLayouts.EvenPages = pl;
// define PageLayout for odd pages
pl = new PageLayout();
// odd pages will have 2 columns
pl.Columns.Add();
pl.Columns.Add();
pl.PageSettings = new C1PageSettings();
pl.PageSettings.PaperKind = PaperKind.Letter;
pl.PageSettings.Landscape = true;
// create the page header
ph = new RenderText();
ph.Text = "Odd page. [PageNo] / [PageCount]";
ph.Style.Borders.All = LineDef.DefaultBold;
ph.Style.BackColor = Color.LightSeaGreen;
pl.PageHeader = ph;
// create the page footer
RenderText pf = new RenderText();
pf.Text = "Footer of odd page. [PageNo] / [PageCount]";
pf.Style.Borders.All = LineDef.DefaultBold;
pf.Style.BackColor = Color.SlateGray;
pl.PageFooter = pf;
doc.PageLayouts.OddPages = pl;
// generate the content of document
RenderText ro = new RenderText("This is the first page of the document. It has no page header or footer, and has Legal size.");
ro.BreakAfter = BreakEnum.Page;
doc.Body.Children.Add(ro);
```