# Rect Class

> A rect holds four coordinates for a rectangle.

- Product: Adobe PDF Library 18
- Language: Java
- Version: APDFL18.0.5PlusP2a
- HTML page: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Rect
- Version index: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/llms.txt

```java
class Rect
```

**Namespace:** `com::datalogics::PDFL`

## Description

A rect holds four coordinates for a rectangle. The coordinates for a rectangle include left, top, right, bottom. Width () and height () defines the rectangle's width and height. LLx and LLy defines lower left corner, and URx and URy defines the upper right corner.

**Referenced by:** [`Annotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Annotation.md), [`AxialShadingPattern`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/AxialShadingPattern.md), [`CircleAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/CircleAnnotation.md), [`Container`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Container.md), [`Content`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Content.md), [`Document`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Document.md), [`DrawParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/DrawParams.md), [`Element`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Element.md), [`Font`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Font.md), [`Form`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Form.md), [`FreeTextAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/FreeTextAnnotation.md), [`Group`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Group.md), [`HighlightAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/HighlightAnnotation.md), [`Image`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Image.md), [`InkAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/InkAnnotation.md), [`LineAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/LineAnnotation.md), [`LinkAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/LinkAnnotation.md), [`Page`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Page.md), [`Path`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Path.md), [`PolyLineAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/PolyLineAnnotation.md), [`PolygonAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/PolygonAnnotation.md), [`PostScript`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/PostScript.md), [`PrintParams`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/PrintParams.md), [`Quad`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Quad.md), [`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Rect.md), [`Redaction`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Redaction.md), [`RemoteDestination`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/RemoteDestination.md), [`Shading`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Shading.md), [`ShadingPattern`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/ShadingPattern.md), [`SignDoc`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/SignDoc.md), [`SquareAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/SquareAnnotation.md), [`Text`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Text.md), [`TextMarkupAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/TextMarkupAnnotation.md), [`TextRun`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/TextRun.md), [`UnderlineAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/UnderlineAnnotation.md), [`ViewDestination`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/ViewDestination.md)

**Uses types:** [`Matrix`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Matrix.md), [`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Rect.md)

## Constructors

### Rect

```java
com.datalogics.PDFL.Rect.Rect()
```

*constructor*

Create a rectangle with all values zero.

### Rect

```java
com.datalogics.PDFL.Rect.Rect(double nLLx, double nLLy, double nURx, double nURy)
```

*constructor*

**Parameters**

- `nLLx` (`double`): the X coordinate of the lower left corner of the rectangle
- `nLLy` (`double`): the Y coordinate of the lower left corner of the rectangle
- `nURx` (`double`): the X coordinate of the upper right corner of the rectangle
- `nURy` (`double`): the Y coordinate of the upper right corner of the rectangle

Create a Rect.

### Rect

```java
com.datalogics.PDFL.Rect.Rect(java.awt.geom.Rectangle2D r)
```

*constructor*

**Parameters**

- `r` (`java.awt.geom.Rectangle2D`): a rectangle

Create a Rect from a java.awt rectangle type

Note that the coordinate systems are inverted for PDFL. Smaller X/Y values are assigned to the lower left coordinate.

## Methods

### delete

```java
synchronized void com.datalogics.PDFL.Rect.delete(Boolean disposing)
```

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

```java
synchronized void com.datalogics.PDFL.Rect.delete()
```

**Returns:** `synchronized void`

### equals

```java
boolean com.datalogics.PDFL.Rect.equals(Object rhs)
```

**Parameters**

- `rhs` (`Object`)

**Returns:** `boolean`

### finalize

```java
void com.datalogics.PDFL.Rect.finalize()
```

*protected*

**Returns:** `void`

### getBottom

```java
double com.datalogics.PDFL.Rect.getBottom()
```

**Returns:** `double`

the Y coordinate of the lower left corner of the rectangle.

### getHeight

```java
double com.datalogics.PDFL.Rect.getHeight()
```

**Returns:** `double`

The height of the Rect.

### getLLx

```java
double com.datalogics.PDFL.Rect.getLLx()
```

**Returns:** `double`

the X coordinate of the lower left corner of the rectangle.

### getLLy

```java
double com.datalogics.PDFL.Rect.getLLy()
```

**Returns:** `double`

the Y coordinate of the lower left corner of the rectangle.

### getLeft

```java
double com.datalogics.PDFL.Rect.getLeft()
```

**Returns:** `double`

the X coordinate of the lower left corner of the rectangle.

### getRight

```java
double com.datalogics.PDFL.Rect.getRight()
```

**Returns:** `double`

the X coordinate of the upper right corner of the rectangle.

### getTop

```java
double com.datalogics.PDFL.Rect.getTop()
```

**Returns:** `double`

the Y coordinate of the upper right corner of the rectangle.

### getURx

```java
double com.datalogics.PDFL.Rect.getURx()
```

**Returns:** `double`

the X coordinate of the upper right corner of the rectangle.

### getURy

```java
double com.datalogics.PDFL.Rect.getURy()
```

**Returns:** `double`

the Y coordinate of the upper right corner of the rectangle.

### getWidth

```java
double com.datalogics.PDFL.Rect.getWidth()
```

**Returns:** `double`

The width of the Rect.

### inRect

```java
boolean com.datalogics.PDFL.Rect.inRect(Rect r2)
```

**Parameters**

- `r2` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Rect.md))

**Returns:** `boolean`

Check if this rectangle is inside the parameter rectangle.

### intersect

```java
Rect com.datalogics.PDFL.Rect.intersect(Rect r2)
```

**Parameters**

- `r2` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Rect.md))

**Returns:** [`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Rect.md)

Obtain the intersection of this rectangle and another rectangle.

### isEmpty

```java
boolean com.datalogics.PDFL.Rect.isEmpty()
```

**Returns:** `boolean`

Check if this rectangle is empty.

### overlaps

```java
boolean com.datalogics.PDFL.Rect.overlaps(Rect r2)
```

**Parameters**

- `r2` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Rect.md))

**Returns:** `boolean`

Check if two rectangles overlap.

### setBottom

```java
void com.datalogics.PDFL.Rect.setBottom(double bottom)
```

**Parameters**

- `bottom` (`double`)

**Returns:** `void`

the Y coordinate of the lower left corner of the rectangle.

### setLLx

```java
void com.datalogics.PDFL.Rect.setLLx(double value)
```

**Parameters**

- `value` (`double`)

**Returns:** `void`

the X coordinate of the lower left corner of the rectangle.

### setLLy

```java
void com.datalogics.PDFL.Rect.setLLy(double value)
```

**Parameters**

- `value` (`double`)

**Returns:** `void`

the Y coordinate of the lower left corner of the rectangle.

### setLeft

```java
void com.datalogics.PDFL.Rect.setLeft(double left)
```

**Parameters**

- `left` (`double`)

**Returns:** `void`

the X coordinate of the lower left corner of the rectangle.

### setRight

```java
void com.datalogics.PDFL.Rect.setRight(double right)
```

**Parameters**

- `right` (`double`)

**Returns:** `void`

the X coordinate of the upper right corner of the rectangle.

### setTop

```java
void com.datalogics.PDFL.Rect.setTop(double top)
```

**Parameters**

- `top` (`double`)

**Returns:** `void`

the Y coordinate of the upper right corner of the rectangle.

### setURx

```java
void com.datalogics.PDFL.Rect.setURx(double value)
```

**Parameters**

- `value` (`double`)

**Returns:** `void`

the X coordinate of the upper right corner of the rectangle.

### setURy

```java
void com.datalogics.PDFL.Rect.setURy(double value)
```

**Parameters**

- `value` (`double`)

**Returns:** `void`

the Y coordinate of the upper right corner of the rectangle.

### toString

```java
String com.datalogics.PDFL.Rect.toString()
```

**Returns:** `String`

### transform

```java
Rect com.datalogics.PDFL.Rect.transform(Matrix arg0)
```

**Parameters**

- `arg0` ([`Matrix`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Matrix.md))

**Returns:** [`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Rect.md)

Transform the coordinates of the rectangle by the given Matrix Object.
