Table of Contents

Struct PageMargins

Namespace
NetPdf
Assembly
NetPdf.dll

Default page margins applied unless overridden by @page CSS. All values are in CSS pixels (1 in = 96 px at default DPI).

public readonly record struct PageMargins : IEquatable<PageMargins>
Implements
Inherited Members

Constructors

PageMargins(double, double, double, double)

Default page margins applied unless overridden by @page CSS. All values are in CSS pixels (1 in = 96 px at default DPI).

public PageMargins(double TopPx, double RightPx, double BottomPx, double LeftPx)

Parameters

TopPx double
RightPx double
BottomPx double
LeftPx double

Properties

BottomPx

public double BottomPx { get; init; }

Property Value

double

Default

1-inch margin on every side. Equivalent to @page { margin: 1in; }.

public static PageMargins Default { get; }

Property Value

PageMargins

LeftPx

public double LeftPx { get; init; }

Property Value

double

None

Zero margin (edge-to-edge).

public static PageMargins None { get; }

Property Value

PageMargins

RightPx

public double RightPx { get; init; }

Property Value

double

TopPx

public double TopPx { get; init; }

Property Value

double

Methods

Symmetric(double, double)

Vertical / horizontal pair.

public static PageMargins Symmetric(double verticalPx, double horizontalPx)

Parameters

verticalPx double
horizontalPx double

Returns

PageMargins

Uniform(double)

Uniform margin on all four sides.

public static PageMargins Uniform(double px)

Parameters

px double

Returns

PageMargins