Inheritance: java.lang.Object, com.aspose.pdf.Layer

public class Layer extends Object

Represents a layer within a PDF page.

Constructors

ConstructorDescription
LayerInitializes a new instance of the {@code Layer} class.

Methods

MethodDescription
deleteDeletes the current layer from the PDF document.
flattenFlattens the specified layer.
getContents

Gets the layer content.

getDefaultStateGets the default state of the PDF layer.
getIdGets the layer id.
getLockedGets a value indicating whether the layer is locked.
getNameGets the layer name.
lockLocks the layer.
saveSaves the current layer to a PDF document.
saveSaves the current layer to a PDF document.
setDefaultStateSets the default state of the PDF layer.
unlockUnlocks 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:

ParameterTypeDescription
cleanupContentStreamSpecifies 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} object

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.