w:pgMar (Page Margins)
Defines top, bottom, left, right, header, footer, and gutter margins for the page.
Parent elements
Description
w:pgMar defines the page margins for a section. It is defined in ECMA-376 Part 1 §17.6.11.
All values are in twips (1/20 of a point; 1440 twips = 1 inch). The w:header and w:footer values control the distance from the page edge to the header/footer band, not to the main text area.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:top |
ST_SignedTwipsMeasure |
Integer (twips, may be negative). | Top margin (from page edge to main text area). |
w:right |
ST_TwipsMeasure |
Positive integer (twips). | Right margin. |
w:bottom |
ST_SignedTwipsMeasure |
Integer (twips, may be negative). | Bottom margin. |
w:left |
ST_TwipsMeasure |
Positive integer (twips). | Left margin. |
w:header |
ST_TwipsMeasure |
Positive integer (twips). | Distance from top edge to top of header. |
w:footer |
ST_TwipsMeasure |
Positive integer (twips). | Distance from bottom edge to bottom of footer. |
w:gutter |
ST_TwipsMeasure |
Positive integer (twips). | Gutter margin added to binding side. |
Examples
<!-- 2.54 cm (1 inch) all margins -->
<w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440"
w:header="708" w:footer="708" w:gutter="0"/>
new PageMargin
{
Top = 1440,
Right = 1440,
Bottom = 1440,
Left = 1440,
Header = 708,
Footer = 708,
Gutter = 0
};