PdfLayer
12 Sep 20251 minute to read
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();Properties
layers PdfLayerCollection
Gets the collection of PdfLayer from the layer.
locked boolean
Gets the boolean indicating whether the layer is locked or not.
name string
Gets the name of the layer.
printState PdfPrintState
Gets the print state of the layer.
visible boolean
Gets the visibility of the layer.
Methods
createGraphics
Initializes graphics context of the layer.
| Parameter | Type | Description |
|---|---|---|
| page | PdfPage |
The PDF page. |
Returns PdfGraphics