Table of Contents

Class PdfDocumentLayerCollection

Namespace
Syncfusion.Pdf
Assembly
Syncfusion.Pdf.Portable.dll

The class provides methods and properties to handle the collections of PdfLayer

public class PdfDocumentLayerCollection : PdfCollection, IEnumerable
Inheritance
PdfDocumentLayerCollection
Implements
Inherited Members

Properties

this[int]

Gets or sets PdfLayer by its index from PdfDocumentLayerCollection

public PdfLayer this[int index] { get; set; }

Parameters

index int

Property Value

PdfLayer

Methods

Add(string)

Creates a new PdfLayer with name and adds it to the end of the collection.

public PdfLayer Add(string name)

Parameters

name string

Layer Name.

Returns

PdfLayer

Created PdfLayer.

Add(string, bool)

Creates a new PdfLayer with name and Boolean flag to set the visibility of layer, and adds it to the end of the collection.

public PdfLayer Add(string name, bool visible)

Parameters

name string

Layer Name.

visible bool

Layer Visibility.

Returns

PdfLayer

Created PdfLayer.

Clear()

Clears layers from the PdfDocumentLayerCollection.

public void Clear()

Contains(PdfLayer)

Checks whether collection contains PdfLayer.

public bool Contains(PdfLayer layer)

Parameters

layer PdfLayer

PdfLayer object.

Returns

bool

True - if collection contains layer, False otherwise.

Contains(string)

Checks whether collection contains PdfLayer by layer name.

public bool Contains(string name)

Parameters

name string

Returns

bool

True - if collection contains layer, False otherwise.

IndexOf(PdfLayer)

Returns index of the PdfLayer in the collection if exists, -1 otherwise.

public int IndexOf(PdfLayer layer)

Parameters

layer PdfLayer

PdfLayer object.

Returns

int

Returns index of the layer in the collection if exists, -1 otherwise.

Move(int, PdfLayer)

Move PdfLayer into the collection at specified index

public void Move(int index, PdfLayer layer)

Parameters

index int

Index of the layer.

layer PdfLayer

PdfLayer object.

Remove(PdfLayer)

Removes layer from the collection of Layer.

public void Remove(PdfLayer layer)

Parameters

layer PdfLayer

PdfLayer object.

Remove(PdfLayer, bool)

Removes layer from the collection and remove graphical content, If removeGraphicalContent is true.

public void Remove(PdfLayer layer, bool removeGraphicalContent)

Parameters

layer PdfLayer

PdfLayer object.

removeGraphicalContent bool

Remove(string)

Removes PdfLayer from the collection by its name. If document have muliple layer with same name, it removes all PdfLayers from document.

public void Remove(string name)

Parameters

name string

Name of the layer.

Remove(string, bool)

Remove layer from its collection by its name and remove graphical content, If removeGraphicalContent is true

public void Remove(string name, bool removeGraphicalContent)

Parameters

name string
removeGraphicalContent bool

RemoveAt(int)

Removes layer by its index from collections

public void RemoveAt(int index)

Parameters

index int

Index of the layer.

RemoveAt(int, bool)

Removes layer by its index from collections and remove graphical content if removeGraphicalContent is true

public void RemoveAt(int index, bool removeGraphicalContent)

Parameters

index int

Index of the layer.

removeGraphicalContent bool