public class Layer extends Object
Represents a layer within a PDF page.
Constructor and Description |
---|
Layer(String id,
String name)
Initializes a new instance of the
Layer class. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Deletes the current layer from the PDF document.
|
void |
flatten(boolean cleanupContentStream)
Flattens the specified layer.
|
List<Operator> |
getContents()
Gets the layer content.
|
String |
getId()
Gets the layer id.
|
boolean |
getLocked()
Gets a value indicating whether the layer is locked.
|
String |
getName()
Gets the layer name.
|
void |
lock()
Locks the layer.
|
void |
save(OutputStream outputStream)
Saves the current layer to a PDF document.
|
void |
save(String outputPath)
Saves the current layer to a PDF document.
|
void |
unlock()
Unlocks the layer.
|
public String getName()
Gets the layer name.
public String getId()
Gets the layer id.
public List<Operator> getContents()
Gets the layer content.
List<Operator>
objectpublic final void save(String outputPath)
Saves the current layer to a PDF document.
outputPath
- The file path where the PDF document will be saved.public final void save(OutputStream outputStream)
Saves the current layer to a PDF document.
outputStream
- The stream where the PDF document will be saved.public final void flatten(boolean cleanupContentStream)
Flattens the specified layer.
cleanupContentStream
- Specifies whether to remove optional content group markers from the content stream.
Setting the cleanupContentStream
parameter to false speeds up the process of flattening.
public final void lock()
Locks the layer.
public final void unlock()
Unlocks the layer.
public final boolean getLocked()
Gets a value indicating whether the layer is locked.
public final void delete()
Deletes the current layer from the PDF document.
Copyright © 2025 Aspose. All Rights Reserved.