# LineTo Class

> A lineto operator, which draws a straight line.

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

```java
class LineTo : Segment
```

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

**Inherits from:** [`Segment`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Segment.md)

## Description

A lineto operator, which draws a straight line. A lineto operator creates a line path element. It draws a straight line from the current position (MoveTo) to a new position-a new set of (x,y) coordinates: MoveTo{x:0 y:50} LineTo{x:100 y:100}

**Uses types:** [`Point`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Point.md)

## Constructors

### LineTo

```java
com.datalogics.PDFL.LineTo.LineTo(double x, double y)
```

*constructor*

**Parameters**

- `x` (`double`): The horizontal coordinate of the destination point.
- `y` (`double`): The vertical coordinate of the destination point.

Create a line to a new point specified by coordinates. Append a straight line segment from the current point to the point (x, y). The new current point is the point the line is drawn to.

### LineTo

```java
com.datalogics.PDFL.LineTo.LineTo(Point lineToPoint)
```

*constructor*

**Parameters**

- `lineToPoint` ([`Point`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Point.md)): The destination point for the line segment.

Create a line to a new point. Append a straight line segment from the current point to the lineToPoint. The new current point is the point the line is drawn to.

## Methods

### delete

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

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

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

**Returns:** `synchronized void`

### finalize

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

*protected*

**Returns:** `void`

### getPoint

```java
Point com.datalogics.PDFL.LineTo.getPoint()
```

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

The new current point.

### setPoint

```java
void com.datalogics.PDFL.LineTo.setPoint(Point value)
```

**Parameters**

- `value` ([`Point`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Point.md))

**Returns:** `void`

The new current point.

### toString

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

**Returns:** `String`

A string in the format "[ LineTo {x, y} ]".

Returns a string representation of this LineTo segment.
