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

# TextFragmentCollection

## Overview

`TextFragmentCollection` is a class in Aspose.PDF FOSS for .NET.
Inherits from: `System.Collections.Generic.IEnumerable`.

A 1-indexed collection of TextFragment objects, matching the public API.

This class provides 6 methods for working with TextFragmentCollection objects in .NET programs.
Available methods include: `Add`, `Clear`, `Contains`, `CopyTo`, `GetEnumerator`, `Remove`.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: `Count`, `IsReadOnly`, `IsSynchronized`, `SyncRoot`.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `Count` | `int` | Read | Number of fragments. |
| `IsReadOnly` | `bool` | Read | Gets the is read only. |
| `IsSynchronized` | `bool` | Read | Gets the is synchronized. |
| `SyncRoot` | `object` | Read | Gets the sync root. |

## Methods

| Signature | Description |
|-----------|-------------|
| `Add(fragment: TextFragment)` | Calls Add on this TextFragmentCollection instance. |
| `Contains(item: TextFragment)` | Calls Contains on this TextFragmentCollection instance. |
| `CopyTo(array: TextFragment[], index: int)` | Calls CopyTo on this TextFragmentCollection instance. |
| `Remove(item: TextFragment)` | Calls Remove on this TextFragmentCollection instance. |
| `Clear()` | Clear all fragments from the collection. |
| `GetEnumerator()` | Calls GetEnumerator on this TextFragmentCollection instance. |

## See Also

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