Layer
Overview
Layer is a class in Aspose.PDF FOSS for .NET.
A PDF layer (Optional Content Group) as exposed through Layers.
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 | The layer identifier (page-resource property name once attached). |
Name | string | Read | The layer’s human-readable name. |
Contents | List<Operator> | Read | Operators that make up this layer’s content. |
DefaultState | DefaultState | Read/Write | Default visibility state. |
Locked | bool | Read | Whether the layer is locked (cannot be toggled by the viewer). |
Methods
| Signature | Description |
|---|---|
Layer(id: string, name: string) | Create a new, detached layer. |
Lock() | Lock this layer. |
Unlock() | Unlock this layer. |
Delete() | Remove this layer and its content from the page. |
Flatten(cleanupContentStream: bool) | Flatten this layer’s content into the unconditional page content. |
Save(outputStream: System.IO.Stream) | Save this layer’s content as a standalone single-page PDF stream. |
Save(outputPath: string) | Save this layer’s content as a standalone single-page PDF file. |