<!-- Generated by tools/SharpCell.Docs from the XML documentation comments. Do not edit; run the tool with 'generate'. -->

# PageMargins

```csharp
public sealed class PageMargins
```

Namespace `SharpCell` · package `SharpCell`

The margins of a printed sheet in inches, as in Excel's Page Setup > Margins: the space around the cells, and how far the header and footer are from the top and bottom edges.

## Constructors

<a id="ctor-double-double-double-double-double-double"></a>
### PageMargins(double, double, double, double, double, double)

```csharp
public PageMargins(double left, double right, double top, double bottom, double header, double footer)
```

Margins of the given sizes in inches.

**Exceptions**

- `ArgumentOutOfRangeException`: A margin is negative, not a number, or 49 inches or more.

## Properties

<a id="bottom"></a>
### Bottom

```csharp
public double Bottom { get; init; }
```

The bottom margin in inches.

**Exceptions**

- `ArgumentOutOfRangeException`: The value is negative, not a number, or 49 inches or more.

<a id="footer"></a>
### Footer

```csharp
public double Footer { get; init; }
```

How far the footer is from the bottom edge, in inches.

**Exceptions**

- `ArgumentOutOfRangeException`: The value is negative, not a number, or 49 inches or more.

<a id="header"></a>
### Header

```csharp
public double Header { get; init; }
```

How far the header is from the top edge, in inches.

**Exceptions**

- `ArgumentOutOfRangeException`: The value is negative, not a number, or 49 inches or more.

<a id="left"></a>
### Left

```csharp
public double Left { get; init; }
```

The left margin in inches.

**Exceptions**

- `ArgumentOutOfRangeException`: The value is negative, not a number, or 49 inches or more.

<a id="narrow"></a>
### Narrow

```csharp
public static PageMargins Narrow { get; }
```

Excel's Narrow margins: 0.25 inches left and right, 0.75 top and bottom, 0.3 for the header and footer.

<a id="normal"></a>
### Normal

```csharp
public static PageMargins Normal { get; }
```

Excel's Normal margins, which a sheet has unless set otherwise: 0.7 inches left and right, 0.75 top and bottom, 0.3 for the header and footer.

<a id="right"></a>
### Right

```csharp
public double Right { get; init; }
```

The right margin in inches.

**Exceptions**

- `ArgumentOutOfRangeException`: The value is negative, not a number, or 49 inches or more.

<a id="top"></a>
### Top

```csharp
public double Top { get; init; }
```

The top margin in inches.

**Exceptions**

- `ArgumentOutOfRangeException`: The value is negative, not a number, or 49 inches or more.

<a id="wide"></a>
### Wide

```csharp
public static PageMargins Wide { get; }
```

Excel's Wide margins: an inch on every side, 0.5 inches for the header and footer.
