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

# AnnotationCollection

## Overview

`AnnotationCollection` is a type in Aspose.PDF FOSS for Go.

AnnotationCollection is the live, ordered set of annotations attached to a single page.

This type declares 7 methods for AnnotationCollection objects in Go programs.
Available methods include: `Add`, `All`, `At`, `Count`, `Delete`, `DeleteAt`, `Flatten`.
Public members are accessible to any Go application after installing the Aspose.PDF FOSS for Go package.

## Methods

| Signature | Description |
|-----------|-------------|
| `Count()` → `int` | Count reports how many annotations live on this page. |
| `All()` → `[]Annotation` | All returns the page's annotations as a slice. |
| `Add(a: Annotation)` → `error` | Add attaches an annotation to this page. |
| `At(index: int)` → `Annotation` | At returns the annotation at the given index. |
| `Delete(a: Annotation)` → `bool` | Delete removes the annotation from this page. |
| `DeleteAt(index: int)` → `error` | DeleteAt removes the annotation at the given index. |
| `Flatten()` → `error` | Flatten bakes every annotation on the page into the page content and removes it. |

## See Also

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