Click or drag to resize

Layer Class

A layer of a PDF document (optional content): content a viewer can show or hide, as in Acrobat's Layers panel. Obtained from Layers.
Inheritance Hierarchy
SystemObject
  ExpertPdf.Anywhere.PdfDocumentLayer

Namespace: ExpertPdf.Anywhere.PdfDocument
Assembly: ExpertPdf.Anywhere (in ExpertPdf.Anywhere.dll) Version: 22.0
Syntax
public class Layer

The Layer type exposes the following members.

Properties
 NameDescription
Public propertyLayersGets the layers nested under this one in a viewer's layer list.
Public propertyLockedGets or sets whether a viewer lets the reader show or hide the layer (locked: it does not).
Public propertyNameGets or sets the name of the layer, as a viewer lists it.
Public propertyVisibleGets or sets whether the layer is shown when the document is opened.
Top
Methods
 NameDescription
Public methodEqualsGets whether this object stands for the same layer of the same document.
(Overrides ObjectEquals(Object))
Public methodGetHashCodeReturns a hash code for the layer.
(Overrides ObjectGetHashCode)
Public methodToStringReturns the name of the layer.
(Overrides ObjectToString)
Top
Remarks
The layers of a loaded document can be listed, shown or hidden, locked, renamed, added, removed (with or without what they draw) and flattened; page objects can be moved into a layer with Layer.
Example
Document document = new Document("in.pdf");
foreach (Layer layer in document.Layers)
    Console.WriteLine(layer.Name + (layer.Visible ? "" : " (hidden)"));
document.Layers["Draft"].Visible = false;
document.Save("out.pdf");
document.Close();
See Also