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

# Collection

## Overview

`Collection` is a class in Aspose.PDF FOSS for .NET.
Inherits from: `EmbeddedFileCollection`.

PDF Portfolio collection.

This class provides 8 methods for working with Collection objects in .NET programs.
Available methods include: `Add`, `Collection`, `CopyTo`, `Delete`, `DeleteByKey`, `FindByName`, `GetEnumerator`, `GetSortedCollection`.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: `Count`, `DefaultEntry`, `IsSynchronized`, `Keys`, `Schema`, `SyncRoot`.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `DefaultEntry` | `string` | Read | The catalog's default-entry name for this portfolio (/D entry), or empty. |
| `Schema` | `CollectionSchema?` | Read | Collection schema (PDF spec §7.11.5). |
| `Count` | `int` | Read | Gets the count. |
| `IsSynchronized` | `bool` | Read | Gets the is synchronized. |
| `SyncRoot` | `object` | Read | Gets the sync root. |
| `Keys` | `List` | Read | The names of all embedded files in this collection. |

## Methods

| Signature | Description |
|-----------|-------------|
| `Collection()` | Construct an empty portfolio collection. |
| `GetSortedCollection()` | Returns the file specifications ordered by the /Collection /Sort dict (PDF spec §7.11.4 Table 73). |
| `Add(file: FileSpecification)` | Add an embedded file attachment to the document. |
| `CopyTo(array: FileSpecification[], index: int)` | Calls CopyTo on this Collection instance. |
| `FindByName(name: string)` | Look up an embedded file by its registered name. |
| `DeleteByKey(key: string)` | Sibling of Delete(string) using by-key naming. |
| `Delete()` | Removes all embedded files from the document's /Names/EmbeddedFiles name tree. |
| `GetEnumerator()` | Calls GetEnumerator on this Collection instance. |

## See Also

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