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

# Layer

## Overview

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

This class provides 7 methods for working with Layer objects in .NET programs.
Available methods include: `Delete`, `Flatten`, `Layer`, `Lock`, `Save`, `Unlock`.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: `Contents`, `DefaultState`, `Id`, `Locked`, `Name`.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `Id` | `string` | Read | Gets the id. |
| `Name` | `string` | Read | Gets the name. |
| `Contents` | `List` | Read | Gets the contents. |
| `DefaultState` | `DefaultState` | Read/Write | Gets or sets the default state. |
| `Locked` | `bool` | Read | Gets the locked. |

## Methods

| Signature | Description |
|-----------|-------------|
| `Layer(id: string, name: string)` | Calls Layer on this Layer instance. |
| `Lock()` | Calls Lock on this Layer instance. |
| `Unlock()` | Calls Unlock on this Layer instance. |
| `Delete()` | Drop the layer (no-op on a detached Layer stub — there's no owning page for the stored shape). |
| `Flatten(cleanupContentStream: bool)` | Flatten layer contents into the unconditional content stream. |
| `Save(outputStream: System.IO.Stream)` | Save the layer's content to a stream. |
| `Save(outputPath: string)` | Save the layer's content to a file. |

## See Also

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