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

# DestinationCollection

## Overview

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

Named-destination collection exposed as IEnumerable&lt;KeyValuePair&lt;string, object&gt;&gt;.

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

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `Count` | `int` | Read | Number of destinations (named-destination tree entries plus locally-added overlay entries). |
| `IsReadOnly` | `bool` | Read | Always false: callers may extend via the local overlay. |

## Methods

| Signature | Description |
|-----------|-------------|
| `GetPageNumber(destinameName: string, useCache: bool)` | Get the 1-based page number for a named destination. |
| `GetPageNumber(destinameName: string)` | Convenience overload that always caches. |
| `GetExplicitDestination(destinameName: string, useCache: bool)` | Resolve a named destination to an ExplicitDestination; returns null when not found. |
| `Add(item: System.Collections.Generic.KeyValuePair)` | Append a (name → destination) pair to the local overlay. |
| `Clear()` | Remove every overlay entry. |
| `Contains(value: System.Collections.Generic.KeyValuePair)` | Whether value is present in the snapshot (named destinations or overlay). |
| `CopyTo(array: System.Collections.Generic.KeyValuePair[], arrayIndex: int)` | Copy the snapshot into array starting at arrayIndex. |
| `IndexOf(value: System.Collections.Generic.KeyValuePair)` | Index of value in the snapshot, or -1. |
| `Remove(item: System.Collections.Generic.KeyValuePair)` | Remove an overlay entry matching item. |
| `GetEnumerator()` | Calls GetEnumerator on this DestinationCollection instance. |

## See Also

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