Table of Contents

Struct PdfRectangle

Namespace
MiPdf
Assembly
MiPdf.dll

An axis-aligned rectangle in PDF user space (points, origin bottom-left).

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

Constructors

PdfRectangle(double, double, double, double)

An axis-aligned rectangle in PDF user space (points, origin bottom-left).

public PdfRectangle(double Left, double Bottom, double Right, double Top)

Parameters

Left double
Bottom double
Right double
Top double

Properties

Bottom

public double Bottom { get; init; }

Property Value

double

Height

Height in points (Top - Bottom).

public double Height { get; }

Property Value

double

Left

public double Left { get; init; }

Property Value

double

Right

public double Right { get; init; }

Property Value

double

Top

public double Top { get; init; }

Property Value

double

Width

Width in points (Right - Left).

public double Width { get; }

Property Value

double

Methods

Contains(double, double)

Returns true if the point lies inside the rectangle or on its border.

public bool Contains(double x, double y)

Parameters

x double
y double

Returns

bool

FromCorners(double, double, double, double)

Creates a normalized rectangle from two opposite corners given in any order.

public static PdfRectangle FromCorners(double x1, double y1, double x2, double y2)

Parameters

x1 double
y1 double
x2 double
y2 double

Returns

PdfRectangle

FromSize(double, double, double, double)

Creates a rectangle from its lower-left corner (x, y) and its size. Negative sizes are normalized.

public static PdfRectangle FromSize(double x, double y, double width, double height)

Parameters

x double
y double
width double
height double

Returns

PdfRectangle

Inflate(double)

Returns a rectangle enlarged by d points on every side (shrunk if negative).

public PdfRectangle Inflate(double d)

Parameters

d double

Returns

PdfRectangle