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
ArgumentOutOfRangeException: A margin is negative, not a number, or 49 inches or more.
Properties
Bottom
public double Bottom { get; init; }
The bottom margin in inches.
Exceptions
ArgumentOutOfRangeException: The value is negative, not a number, or 49 inches or more.
Footer
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.
Header
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.
Left
public double Left { get; init; }
The left margin in inches.
Exceptions
ArgumentOutOfRangeException: The value is negative, not a number, or 49 inches or more.
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.
Right
public double Right { get; init; }
The right margin in inches.
Exceptions
ArgumentOutOfRangeException: The value is negative, not a number, or 49 inches or more.
Top
public double Top { get; init; }
The top margin in inches.
Exceptions
ArgumentOutOfRangeException: The value is negative, not a number, or 49 inches or more.
Wide
public static PageMargins Wide { get; }
Excel's Wide margins: an inch on every side, 0.5 inches for the header and footer.