com.spire.pdf.graphics.layer
Class PdfLayerCollection

java.lang.Object
  extended by com.spire.pdf.graphics.layer.PdfLayerCollection

public class PdfLayerCollection
extends java.lang.Object

Represent pdf layer collection.


Constructor Summary
PdfLayerCollection(PdfDictionary dictOptionalContentProperties, PdfDocumentBase documentBase)
          Construct an instance with the optional content properties dictionary
PdfLayerCollection(PdfDocumentBase documentBase)
          Construct an instance
 
Method Summary
 PdfLayer addLayer(java.lang.String name)
          Add a new pdf layer.
 PdfLayer addLayer(java.lang.String name, PdfVisibility state)
          Add a new pdf layer.
 PdfLayer get(int index)
          Get the pdf layer of the index.
 PdfLayer get(java.lang.String name)
          Get the pdf layer of name.
 int getCount()
          Gets the number of pdf layers contained.
 PdfLayerOutline newOutline()
          Create a new empty pdf layer outline.
 boolean removeLayer(PdfLayer layer)
          Remove the pdf layer.
 boolean removeLayer(PdfLayer layer, boolean withContent)
          Remove the pdf layer.
 boolean removeLayer(java.lang.String name)
          Remove the pdf layer.
 boolean removeLayer(java.lang.String name, boolean withContent)
          Remove the pdf layer.
 

Constructor Detail

PdfLayerCollection

public PdfLayerCollection(PdfDocumentBase documentBase)
Construct an instance

Parameters:
documentBase - The PdfDocumentBase

PdfLayerCollection

public PdfLayerCollection(PdfDictionary dictOptionalContentProperties,
                          PdfDocumentBase documentBase)
Construct an instance with the optional content properties dictionary

Parameters:
dictOptionalContentProperties - The optional content properties dictionary
documentBase - The PdfDocumentBase.
Method Detail

get

public PdfLayer get(int index)
Get the pdf layer of the index.

Parameters:
index - Pdf layer index
Returns:
Pdf layer

get

public PdfLayer get(java.lang.String name)
Get the pdf layer of name. Notice: Pdf layer name may be is not unique. If exist duplication of name,return first pdf layer of name. If not exist pdf layer of name,return null;

Parameters:
name - Pdf layer name
Returns:
Pdf layer

getCount

public int getCount()
Gets the number of pdf layers contained.


newOutline

public PdfLayerOutline newOutline()
Create a new empty pdf layer outline.

Returns:
Pdf layer outline.

addLayer

public PdfLayer addLayer(java.lang.String name)
Add a new pdf layer.

Parameters:
name - Pdf layer name.
Returns:
Pdf layer.

addLayer

public PdfLayer addLayer(java.lang.String name,
                         PdfVisibility state)
Add a new pdf layer.

Parameters:
name - Pdf layer name.
state - Pdf layer's visibility.
Returns:
Pdf layer.

removeLayer

public boolean removeLayer(PdfLayer layer)
Remove the pdf layer.

Parameters:
layer - The pdf layer.
Returns:
True if item is successfully removed; otherwise, false. This method also returns false if item was not found

removeLayer

public boolean removeLayer(PdfLayer layer,
                           boolean withContent)
Remove the pdf layer.

Parameters:
layer - The pdf layer.
withContent - If true,remove content with the pdf layer.Otherwise,false.
Returns:
True if item is successfully removed; otherwise, false. This method also returns false if item was not found

removeLayer

public boolean removeLayer(java.lang.String name)
Remove the pdf layer.

Parameters:
name - Pdf layer name.
Returns:
True if item is successfully removed; otherwise, false. This method also returns false if item was not found

removeLayer

public boolean removeLayer(java.lang.String name,
                           boolean withContent)
Remove the pdf layer.

Parameters:
name - Pdf layer name.
withContent - If true,remove content with the pdf layer.Otherwise,false.
Returns:
True if item is successfully removed; otherwise, false. This method also returns false if item was not found