Table of Contents

Class PdfLayerMembership

Namespace
iText.Kernel.Pdf.Layer
Assembly
itext.kernel.dll

Content typically belongs to a single optional content group, and is visible when the group is ON and invisible when it is OFF.

public class PdfLayerMembership : PdfObjectWrapper<PdfDictionary>, IPdfOCG
Inheritance
PdfLayerMembership
Implements
Inherited Members

Remarks

Content typically belongs to a single optional content group, and is visible when the group is ON and invisible when it is OFF. To express more complex visibility policies, content should not declare itself to belong to an optional content group directly, but rather to an optional content membership dictionary represented by this class.

To be able to be wrapped with this PdfObjectWrapper<T> the PdfObject must be indirect.

Constructors

PdfLayerMembership(PdfDictionary)

Creates a new PdfLayerMembership instance by its PdfDictionary, which must be an indirect object.

public PdfLayerMembership(PdfDictionary membershipDictionary)

Parameters

membershipDictionary PdfDictionary

the membership dictionary, must have an indirect reference.

PdfLayerMembership(PdfDocument)

Creates a new, empty membership layer.

public PdfLayerMembership(PdfDocument doc)

Parameters

doc PdfDocument

a PdfDocument where a new empty membership layer creates

Methods

AddLayer(PdfLayer)

Adds a new layer to the current layer membership.

public virtual void AddLayer(PdfLayer layer)

Parameters

layer PdfLayer

the layer to be added

GetDocument()

Gets the PdfDocument that owns that layer membership.

protected virtual PdfDocument GetDocument()

Returns

PdfDocument

the PdfDocument that owns that layer membership

GetIndirectReference()

public virtual PdfIndirectReference GetIndirectReference()

Returns

PdfIndirectReference

GetLayers()

Gets the collection of the layers this layer membership operates with.

public virtual ICollection<PdfLayer> GetLayers()

Returns

ICollection<PdfLayer>

list of layers this layer membership operates with

GetVisibilityExpression()

Gets the visibility expression for content belonging to this optional content membership dictionary.

public virtual PdfVisibilityExpression GetVisibilityExpression()

Returns

PdfVisibilityExpression

the visibility expression for content belonging to this membership dictionary, if not set return null

GetVisibilityPolicy()

Gets the visibility policy for content belonging to this optional content membership dictionary.

public virtual PdfName GetVisibilityPolicy()

Returns

PdfName

the visibility policy for content belonging to this membership dictionary

IsWrappedObjectMustBeIndirect()

protected override bool IsWrappedObjectMustBeIndirect()

Returns

bool

SetVisibilityExpression(PdfVisibilityExpression)

Sets the visibility expression for content belonging to this membership dictionary.

public virtual void SetVisibilityExpression(PdfVisibilityExpression visibilityExpression)

Parameters

visibilityExpression PdfVisibilityExpression

A (nested) array of which the first value is /And, /Or, or /Not followed by a series of indirect references to OCGs or other visibility expressions.

SetVisibilityPolicy(PdfName)

Sets the visibility policy for content belonging to this membership dictionary.

public virtual void SetVisibilityPolicy(PdfName visibilityPolicy)

Parameters

visibilityPolicy PdfName

the visibility policy

Remarks

Sets the visibility policy for content belonging to this membership dictionary. Possible values are AllOn, AnyOn, AnyOff and AllOff. AllOn - Visible only if all of the entries are ON. AnyOn - Visible if any of the entries are ON. AnyOff - Visible if any of the entries are OFF. AllOff - Visible only if all of the entries are OFF. The default value is AnyOn.