---
Product: Aspose.PDF
Platform: net
Page Type: reference
Canonical URL: https://reference.aspose.org/pdf/net/Line
---

# Line

## Overview

`Line` is a class in Aspose.PDF FOSS for .NET.
Inherits from: `Shape`.

A line shape.

This class provides 4 methods for working with Line objects in .NET programs.
Available methods include: `CheckBounds`, `Line`.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: `GraphInfo`, `PositionArray`, `Text`, `X1`, `X2`, `Y1`, and 1 more.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `X1` | `double` | Read/Write | Gets or sets the x1. |
| `Y1` | `double` | Read/Write | Gets or sets the y1. |
| `X2` | `double` | Read/Write | Gets or sets the x2. |
| `Y2` | `double` | Read/Write | Gets or sets the y2. |
| `PositionArray` | `float[]` | Read/Write | Polyline vertices as a flat [x0, y0, x1, y1, ...] array. |
| `GraphInfo` | `Aspose.Pdf.GraphInfo` | Read/Write | Gets or sets the graph info. |
| `Text` | `Aspose.Pdf.Text.TextFragment?` | Read/Write | Optional text label rendered with the shape. |

## Methods

| Signature | Description |
|-----------|-------------|
| `Line(x1: double, y1: double, x2: double, y2: double)` | Calls Line on this Line instance. |
| `Line(positionArray: float[])` | Create a line (or polyline) from a flat coordinate array [x0, y0, x1, y1, ...]. |
| `CheckBounds(containerWidth: double, containerHeight: double)` | Whether every vertex lies within the container's AABB anchored at the origin. |
| `Line(coordinates: double[])` | Create a line (or polyline) from a flat coordinate array [x0, y0, x1, y1, ...]. |

## See Also

- [Aspose.PDF for .NET — Enterprise API Reference](https://reference.aspose.com/pdf/net/)