SharpCell

PageMargins

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

PageMargins(double, double, double, double, double, double)

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

Margins of the given sizes in inches.

Exceptions

Properties

Bottom

public double Bottom { get; init; }

The bottom margin in inches.

Exceptions

public double Footer { get; init; }

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

Exceptions

public double Header { get; init; }

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

Exceptions

Left

public double Left { get; init; }

The left margin in inches.

Exceptions

Narrow

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.

Normal

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.

public double Right { get; init; }

The right margin in inches.

Exceptions

Top

public double Top { get; init; }

The top margin in inches.

Exceptions

Wide

public static PageMargins Wide { get; }

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