# PdfTextLayout class

> A paragraph broken into lines for a given width: the Unicode line breaking algorithm finds break opportunities, the bidirectional algorithm orders each...

Namespace: [PdfNetStack.Drawing](https://www.jadev-corp.com/api/pdfnetstack-drawing/)  
Assembly: PdfNetStack.dll  
Package: `PdfNetStack`

A paragraph broken into lines for a given width: the Unicode line breaking algorithm finds
break opportunities, the bidirectional algorithm orders each line, and an OpenType shaper
forms the glyphs. Measure with it, then draw it with [DrawText](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfgraphics/#PdfNetStack_Drawing_PdfGraphics_DrawText_PdfNetStack_Drawing_PdfTextLayout_System_Double_System_Double_).

```csharp
public sealed class PdfTextLayout
```

**Inheritance**

[object](https://learn.microsoft.com/dotnet/api/system.object) ← 
[PdfTextLayout](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdftextlayout/)

## Remarks

Lines are filled greedily, breaking at spaces, at soft hyphens and, with
[Hyphenator](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfparagraph/#PdfNetStack_Drawing_PdfParagraph_Hyphenator), inside words. A word still wider than the line is broken
between characters. Trailing spaces do not count toward a line's width. Line height follows
the CSS model: each span's font contributes its ascent and descent, spread by the paragraph's
line height.

## Properties

### <a id="PdfNetStack_Drawing_PdfTextLayout_Height"></a> Height

Total height of all lines.

```csharp
public double Height { get; }
```

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

### <a id="PdfNetStack_Drawing_PdfTextLayout_Lines"></a> Lines

The lines, top to bottom.

```csharp
public IReadOnlyList<PdfTextLine> Lines { get; }
```

#### Property Value

 [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[PdfTextLine](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdftextline/)\>

### <a id="PdfNetStack_Drawing_PdfTextLayout_MaxWidth"></a> MaxWidth

The width lines were broken for.

```csharp
public double MaxWidth { get; }
```

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

### <a id="PdfNetStack_Drawing_PdfTextLayout_Paragraph"></a> Paragraph

The laid out paragraph.

```csharp
public PdfParagraph Paragraph { get; }
```

#### Property Value

 [PdfParagraph](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfparagraph/)

### <a id="PdfNetStack_Drawing_PdfTextLayout_Width"></a> Width

Width of the widest line.

```csharp
public double Width { get; }
```

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

## Methods

### <a id="PdfNetStack_Drawing_PdfTextLayout_Create_PdfNetStack_Drawing_PdfParagraph_System_Double_"></a> Create\(PdfParagraph, double\)

Breaks <code class="paramref">paragraph</code> into lines no wider than <code class="paramref">width</code> points.

```csharp
public static PdfTextLayout Create(PdfParagraph paragraph, double width)
```

#### Parameters

`paragraph` [PdfParagraph](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfparagraph/)

`width` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

 [PdfTextLayout](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdftextlayout/)

#### Exceptions

 [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception)

A character has no glyph in its style's font or fallbacks.

## Used in

- [PDF coordinates and units in PdfNetStack](https://www.jadev-corp.com/concepts/coordinates-and-units/)
- [Fonts and text in PDF with C# and .NET](https://www.jadev-corp.com/guides/fonts-and-text/)

Source: https://www.jadev-corp.com/pdfnetstack/api/pdfnetstack-drawing/pdftextlayout/
