Class PdfDocumentLayerCollection
The class provides methods and properties to handle the collections of PdfLayer
Implements
Inherited Members
Namespace: Syncfusion.Pdf
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfDocumentLayerCollection : PdfCollection, IEnumerable
Properties
Item[Int32]
Gets or sets PdfLayer by its index from PdfDocumentLayerCollection
Declaration
public PdfLayer this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type |
---|
PdfLayer |
Methods
Add(String)
Creates a new PdfLayer with name and adds it to the end of the collection.
Declaration
public PdfLayer Add(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Layer Name. |
Returns
Type | Description |
---|---|
PdfLayer | Created PdfLayer. |
Add(String, Boolean)
Creates a new PdfLayer with name and Boolean flag to set the visibility of layer, and adds it to the end of the collection.
Declaration
public PdfLayer Add(string name, bool visible)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Layer Name. |
System.Boolean | visible | Layer Visibility. |
Returns
Type | Description |
---|---|
PdfLayer | Created PdfLayer. |
Clear()
Clears layers from the PdfDocumentLayerCollection.
Declaration
public void Clear()
Contains(PdfLayer)
Checks whether collection contains PdfLayer.
Declaration
public bool Contains(PdfLayer layer)
Parameters
Type | Name | Description |
---|---|---|
PdfLayer | layer | PdfLayer object. |
Returns
Type | Description |
---|---|
System.Boolean | True - if collection contains layer, False otherwise. |
Contains(String)
Checks whether collection contains PdfLayer by layer name.
Declaration
public bool Contains(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type | Description |
---|---|
System.Boolean | True - if collection contains layer, False otherwise. |
IndexOf(PdfLayer)
Returns index of the PdfLayer in the collection if exists, -1 otherwise.
Declaration
public int IndexOf(PdfLayer layer)
Parameters
Type | Name | Description |
---|---|---|
PdfLayer | layer | PdfLayer object. |
Returns
Type | Description |
---|---|
System.Int32 | Returns index of the layer in the collection if exists, -1 otherwise. |
Move(Int32, PdfLayer)
Move PdfLayer into the collection at specified index
Declaration
public void Move(int index, PdfLayer layer)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the layer. |
PdfLayer | layer | PdfLayer object. |
Remove(PdfLayer)
Removes layer from the collection of Layer.
Declaration
public void Remove(PdfLayer layer)
Parameters
Type | Name | Description |
---|---|---|
PdfLayer | layer | PdfLayer object. |
Remove(PdfLayer, Boolean)
Removes layer from the collection and remove graphical content, If removeGraphicalContent is true.
Declaration
public void Remove(PdfLayer layer, bool removeGraphicalContent)
Parameters
Type | Name | Description |
---|---|---|
PdfLayer | layer | PdfLayer object. |
System.Boolean | removeGraphicalContent |
Remove(String)
Removes PdfLayer from the collection by its name. If document have muliple layer with same name, it removes all PdfLayers from document.
Declaration
public void Remove(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the layer. |
Remove(String, Boolean)
Remove layer from its collection by its name and remove graphical content, If removeGraphicalContent is true
Declaration
public void Remove(string name, bool removeGraphicalContent)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
System.Boolean | removeGraphicalContent |
RemoveAt(Int32)
Removes layer by its index from collections
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the layer. |
RemoveAt(Int32, Boolean)
Removes layer by its index from collections and remove graphical content if removeGraphicalContent is true
Declaration
public void RemoveAt(int index, bool removeGraphicalContent)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the layer. |
System.Boolean | removeGraphicalContent |