Represents the base class for layer objects.
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data);
// Access the collection of layers in the document
let layers: PdfLayerCollection = document.layers;
// Retrieve the first layer from the layers collection
let layer: PdfLayer = layers.at(0);
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();
PdfLayerCollection
Gets the collection of PdfLayer
from the layer.
boolean
Gets the boolean indicating whether the layer is locked or not.
string
Gets the name of the layer.
PdfPrintState
Gets the print state of the layer.
boolean
Gets the visibility of the layer.
Initializes graphics context of the layer.
Parameter | Type | Description |
---|---|---|
page | PdfPage |
The PDF page. |
Returns PdfGraphics