Table of Contents

Class Rectangle

Namespace
iTextSharp.text
Assembly
iTextSharp.LGPLv2.Core.dll

A Rectangle is the representation of a geometric figure.

public class Rectangle : Element, IElement
Inheritance
Rectangle
Implements
Derived
Inherited Members

Constructors

Rectangle(float, float)

Constructs a Rectangle-object starting from the origin (0, 0).

public Rectangle(float urx, float ury)

Parameters

urx float

upper right x

ury float

upper right y

Rectangle(float, float, float, float)

constructors

public Rectangle(float llx, float lly, float urx, float ury)

Parameters

llx float

lower left x

lly float

lower left y

urx float

upper right x

ury float

upper right y

Rectangle(Rectangle)

Constructs a Rectangle-object.

public Rectangle(Rectangle rect)

Parameters

rect Rectangle

another Rectangle

Fields

BOTTOM_BORDER

static membervariables (concerning the presence of borders)

public const int BOTTOM_BORDER = 2

Field Value

int

BOX

This represents a type of border.

public const int BOX = 15

Field Value

int

LEFT_BORDER

This represents one side of the border of the Rectangle.

public const int LEFT_BORDER = 4

Field Value

int

Llx

the lower left x-coordinate.

protected float Llx

Field Value

float

Lly

the lower left y-coordinate.

protected float Lly

Field Value

float

NO_BORDER

This represents a rectangle without borders.

public const int NO_BORDER = 0

Field Value

int

RIGHT_BORDER

This represents one side of the border of the Rectangle.

public const int RIGHT_BORDER = 8

Field Value

int

TOP_BORDER

This represents one side of the border of the Rectangle.

public const int TOP_BORDER = 1

Field Value

int

UNDEFINED

This is the value that will be used as undefined.

public const int UNDEFINED = -1

Field Value

int

Urx

the upper right x-coordinate.

protected float Urx

Field Value

float

Ury

the upper right y-coordinate.

protected float Ury

Field Value

float

backgroundColor

membervariables

protected BaseColor backgroundColor

Field Value

BaseColor

border

This represents the status of the 4 sides of the rectangle.

protected int border

Field Value

int

borderColor

This is the color of the border of this rectangle.

protected BaseColor borderColor

Field Value

BaseColor

borderColorBottom

The color of the bottom border of this rectangle.

protected BaseColor borderColorBottom

Field Value

BaseColor

borderColorLeft

The color of the left border of this rectangle.

protected BaseColor borderColorLeft

Field Value

BaseColor

borderColorRight

The color of the right border of this rectangle.

protected BaseColor borderColorRight

Field Value

BaseColor

borderColorTop

The color of the top border of this rectangle.

protected BaseColor borderColorTop

Field Value

BaseColor

borderWidth

This is the width of the border around this rectangle.

protected float borderWidth

Field Value

float

borderWidthBottom

The width of the bottom border of this rectangle.

protected float borderWidthBottom

Field Value

float

borderWidthLeft

The width of the left border of this rectangle.

protected float borderWidthLeft

Field Value

float

borderWidthRight

The width of the right border of this rectangle.

protected float borderWidthRight

Field Value

float

borderWidthTop

The width of the top border of this rectangle.

protected float borderWidthTop

Field Value

float

rotation

This is the rotation value of this rectangle.

protected int rotation

Field Value

int

useVariableBorders

Whether variable width borders are used.

protected bool useVariableBorders

Field Value

bool

Properties

BackgroundColor

Gets the backgroundcolor.

public virtual BaseColor BackgroundColor { get; set; }

Property Value

BaseColor

Border

Get/set the border

public virtual int Border { get; set; }

Property Value

int

a int

BorderColor

Gets the color of the border.

public virtual BaseColor BorderColor { get; set; }

Property Value

BaseColor

a value

BorderColorBottom

public virtual BaseColor BorderColorBottom { get; set; }

Property Value

BaseColor

BorderColorLeft

public virtual BaseColor BorderColorLeft { get; set; }

Property Value

BaseColor

BorderColorRight

public virtual BaseColor BorderColorRight { get; set; }

Property Value

BaseColor

BorderColorTop

public virtual BaseColor BorderColorTop { get; set; }

Property Value

BaseColor

BorderWidth

Get/set the borderwidth.

public virtual float BorderWidth { get; set; }

Property Value

float

a float

BorderWidthBottom

public virtual float BorderWidthBottom { get; set; }

Property Value

float

BorderWidthLeft

public virtual float BorderWidthLeft { get; set; }

Property Value

float

BorderWidthRight

public virtual float BorderWidthRight { get; set; }

Property Value

float

BorderWidthTop

public virtual float BorderWidthTop { get; set; }

Property Value

float

Bottom

Get/set the lower left y-coordinate.

public virtual float Bottom { get; set; }

Property Value

float

a float

Chunks

Gets all the chunks in this element.

public virtual IList<Chunk> Chunks { get; }

Property Value

IList<Chunk>

an ArrayList

GrayFill

Get/set the grayscale of the rectangle.

public virtual float GrayFill { get; set; }

Property Value

float

a float

Height

Returns the height of the rectangle.

public float Height { get; }

Property Value

float

a height

Left

Get/set the lower left x-coordinate.

public virtual float Left { get; set; }

Property Value

float

a float

Right

methods to get the membervariables

public virtual float Right { get; set; }

Property Value

float

a float

Rotation

Returns the rotation

public int Rotation { get; }

Property Value

int

a int

Top

Get/set the upper right y-coordinate.

public virtual float Top { get; set; }

Property Value

float

a float

Type

Gets the type of the text element.

public virtual int Type { get; }

Property Value

int

a type

UseVariableBorders

Sets a parameter indicating if the rectangle has variable borders indication if the rectangle has variable borders

public virtual bool UseVariableBorders { get; set; }

Property Value

bool

Width

Returns the width of the rectangle.

public virtual float Width { get; set; }

Property Value

float

a width

Methods

CloneNonPositionParameters(Rectangle)

public virtual void CloneNonPositionParameters(Rectangle rect)

Parameters

rect Rectangle

DisableBorderSide(int)

Disables the border on the specified side. the side to disable. One of LEFT, RIGHT, TOP, BOTTOM

public virtual void DisableBorderSide(int side)

Parameters

side int

EnableBorderSide(int)

methods to set the membervariables

public virtual void EnableBorderSide(int side)

Parameters

side int

GetBottom(float)

Returns the lower left y-coordinate, considering a given margin.

public virtual float GetBottom(float margin)

Parameters

margin float

a margin

Returns

float

the lower left y-coordinate

GetLeft(float)

Returns the lower left x-coordinate, considering a given margin.

public virtual float GetLeft(float margin)

Parameters

margin float

a margin

Returns

float

the lower left x-coordinate

GetRectangle(float, float)

Gets a Rectangle that is altered to fit on the page.

public Rectangle GetRectangle(float top, float bottom)

Parameters

top float

the top position

bottom float

the bottom position

Returns

Rectangle

a Rectangle

GetRight(float)

Returns the upper right x-coordinate, considering a given margin.

public virtual float GetRight(float margin)

Parameters

margin float

a margin

Returns

float

the upper right x-coordinate

GetTop(float)

Returns the upper right y-coordinate, considering a given margin.

public virtual float GetTop(float margin)

Parameters

margin float

a margin

Returns

float

the upper right y-coordinate

HasBorder(int)

Indicates if the table has a some type of border.

public bool HasBorder(int type)

Parameters

type int

the type of border

Returns

bool

a bool

HasBorders()

Indicates if the table has borders.

public bool HasBorders()

Returns

bool

a bool

IsContent()

@see com.lowagie.text.Element#isContent() @since iText 2.0.8

public bool IsContent()

Returns

bool

IsNestable()

@see com.lowagie.text.Element#isNestable() @since iText 2.0.8

public virtual bool IsNestable()

Returns

bool

Normalize()

Switches lowerleft with upperright

public virtual void Normalize()

Process(IElementListener)

Processes the element by adding it (or the different parts) to an IElementListener.

public virtual bool Process(IElementListener listener)

Parameters

listener IElementListener

an IElementListener

Returns

bool

true if the element was processed successfully

Rotate()

implementation of the Element interface

public Rectangle Rotate()

Returns

Rectangle

a Rectangle

SoftCloneNonPositionParameters(Rectangle)

public virtual void SoftCloneNonPositionParameters(Rectangle rect)

Parameters

rect Rectangle

ToString()

Updates the border flag for a side based on the specified width. A width of 0 will disable the border on that side. Any other width enables it. width of border border side constant

public override string ToString()

Returns

string