# RectSegment Class

> A rectangle path operator.

- Product: Adobe PDF Library 21
- Language: Modern C++
- Version: 21.4.0
- HTML page: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/RectSegment
- Version index: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/llms.txt

```cpp
class RectSegment : Segment
```

**Namespace:** `datalogics_interface`

**Inherits from:** [`Segment`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/Segment.md)

## Description

A rectangle path operator.

RectSegment represents a single path, or line, within a rectangle, with coordinates xy, xy for the beginning and end of the line.

**Uses types:** [`Point`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/struct/Point.md)

## Constructors

### RectSegment

```cpp
datalogics_interface::RectSegment::RectSegment(const Point &pt, double width, double height)
```

*constructor*

**Parameters**

- `pt` ([`const Point &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/struct/Point.md)): the lower left corner of the rectangle.
- `width` (`double`): the width of the rectangle.
- `height` (`double`): the height of the rectangle.

Append a rectangle to the current path as a complete subpath, with lower-left corner point and dimensions width and height in user space.

### RectSegment

```cpp
datalogics_interface::RectSegment::RectSegment(double x, double y, double width, double height)
```

*constructor*

**Parameters**

- `x` (`double`): the lower left corner of the rectangle.
- `y` (`double`): the width of the rectangle.
- `width` (`double`): the height of the rectangle.
- `height` (`double`)

Append a rectangle to the current path as a complete subpath, with lower-left corner point and dimensions width and height in user space.

### ~RectSegment

```cpp
datalogics_interface::RectSegment::~RectSegment() override
```

*destructor*

## Methods

### height

```cpp
double datalogics_interface::RectSegment::height() const
```

**Returns:** `double`

The height of the rectangle.

### point

```cpp
Point datalogics_interface::RectSegment::point() const
```

**Returns:** [`Point`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/struct/Point.md)

The lower-left corner of the rectangle.

### to_string

```cpp
std::string datalogics_interface::RectSegment::to_string() const override
```

**Returns:** `std::string`

Represents a segment, or a single line, within a path.

### width

```cpp
double datalogics_interface::RectSegment::width() const
```

**Returns:** `double`

The width of the rectangle.
