Layer
Contents
[
Hide
]Inheritance: java.lang.Object, com.aspose.pdf.Layer
public class Layer extends Object
Represents a layer within a PDF page.
Constructors
| Constructor | Description |
|---|---|
| Layer | Initializes a new instance of the {@code Layer} class. |
Methods
| Method | Description |
|---|---|
| delete | Deletes the current layer from the PDF document. |
| flatten | Flattens the specified layer. |
| getContents | Gets the layer content. |
| getDefaultState | Gets the default state of the PDF layer. |
| getId | Gets the layer id. |
| getLocked | Gets a value indicating whether the layer is locked. |
| getName | Gets the layer name. |
| lock | Locks the layer. |
| save | Saves the current layer to a PDF document. |
| save | Saves the current layer to a PDF document. |
| setDefaultState | Sets the default state of the PDF layer. |
| unlock | Unlocks the layer. |
Layer
Initializes a new instance of the {@code Layer} class.
delete
public final void delete()
Deletes the current layer from the PDF document.
flatten
public final void flatten(boolean cleanupContentStream)
Flattens the specified layer.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| cleanupContentStream | Specifies whether to remove optional content group markers from the content stream. Setting the {@code cleanupContentStream} parameter to false speeds up the process of flattening. |
getContents
public List < Operator > getContents()
Gets the layer content.
Returns:
{@code List
getDefaultState
public final DefaultState getDefaultState()
Gets the default state of the PDF layer.
Returns: the default state of the PDF layer.
getId
public String getId()
Gets the layer id.
Returns: String value
getLocked
public final boolean getLocked()
Gets a value indicating whether the layer is locked.
Returns: boolean value
getName
public String getName()
Gets the layer name.
Returns: String value
lock
public final void lock()
Locks the layer.
save
Saves the current layer to a PDF document.
save
Saves the current layer to a PDF document.
setDefaultState
Sets the default state of the PDF layer.
unlock
public final void unlock()
Unlocks the layer.