Class LineTextObject
Represents a single line of text within a PDF page, combining multiple text chunks. Provides access to line content, bounding box, and positioning information.
Lines are derived from TextChunks by grouping text objects that appear on the same visual line based on their vertical position.
Example - Extract lines from a page:
var pdf = PdfDocument.FromFile("document.pdf");
var page = pdf.Pages[0] as PdfPage;
foreach (var line in page.Lines)
{
Console.WriteLine($"Line: {line.Contents}");
Console.WriteLine($"Position: ({line.BoundingBox.Left}, {line.BoundingBox.Top})");
}
Implements
IronSoftware.IDocumentObject
IronSoftware.IDocumentTextObject
IronSoftware.IBoundedDocumentObject
IronSoftware.IBounded
IronSoftware.ITransformable
IronSoftware.IColored
System.ICloneable
IronSoftware.IJsonSerializable
Inherited Members
Namespace: IronPdf.Pages
Assembly: IronPdf.dll
Syntax
public class LineTextObject : TextObject, IPdfTextObject, IPdfDocumentObject, IDocumentObject, IDocumentTextObject, IBoundedDocumentObject, IBounded, ITransformable, IColored, ICloneable, IJsonSerializable
Remarks
Key Properties:
Methods
ToJson()
Serializes this line text object to JSON format.
Declaration
public string ToJson()
Returns
| Type | Description |
|---|---|
| System.String | JSON string representation of this line. |
Exceptions
| Type | Condition |
|---|---|
| System.NotImplementedException | This method is not yet implemented. |
Implements
IronSoftware.IDocumentObject
IronSoftware.IDocumentTextObject
IronSoftware.IBoundedDocumentObject
IronSoftware.IBounded
IronSoftware.ITransformable
IronSoftware.IColored
System.ICloneable
IronSoftware.IJsonSerializable