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

# OptionalContentProperties

## Overview

`OptionalContentProperties` is a class in Aspose.PDF FOSS for .NET.

Collection of Optional Content Groups (layers) in a document.

This class provides 3 methods for working with OptionalContentProperties objects in .NET programs.
Available methods include: `FindByName`, `GetDisplayOrder`, `SetVisibility`.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: `Count`, `Groups`, `Names`.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `Count` | `int` | Read | Number of layers. |
| `Names` | `IReadOnlyList` | Read | All layer names. |
| `Groups` | `IEnumerable` | Read | All groups as an enumerable. |

## Methods

| Signature | Description |
|-----------|-------------|
| `FindByName(name: string)` | Find a layer by name. |
| `GetDisplayOrder()` | Gets the presentation order of layers as specified in /D/Order. |
| `SetVisibility(name: string, visible: bool)` | Set the visibility of a layer by name. |

## See Also

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