iText 8.0.5 API
iText.Kernel.Pdf.Layer.PdfLayerMembership Class Reference

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

Inheritance diagram for iText.Kernel.Pdf.Layer.PdfLayerMembership:
iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary > iText.Kernel.Pdf.Layer.IPdfOCG

Public Member Functions

  PdfLayerMembership (PdfDocument doc)
  Creates a new, empty membership layer. More...
 
  PdfLayerMembership (PdfDictionary membershipDictionary)
  Creates a new PdfLayerMembership instance by its PdfDictionary, which must be an indirect object. More...
 
virtual ICollection< PdfLayer GetLayers ()
  Gets the collection of the layers this layer membership operates with. More...
 
virtual void  AddLayer (PdfLayer layer)
  Adds a new layer to the current layer membership. More...
 
virtual void  SetVisibilityPolicy (PdfName visibilityPolicy)
  Sets the visibility policy for content belonging to this membership dictionary. More...
 
virtual PdfName  GetVisibilityPolicy ()
  Gets the visibility policy for content belonging to this optional content membership dictionary. More...
 
virtual void  SetVisibilityExpression (PdfVisibilityExpression visibilityExpression)
  Sets the visibility expression for content belonging to this membership dictionary. More...
 
virtual PdfVisibilityExpression  GetVisibilityExpression ()
  Gets the visibility expression for content belonging to this optional content membership dictionary. More...
 
virtual PdfIndirectReference  GetIndirectReference ()
  Gets the PdfIndirectReference that represents this layer. More...
 
- Public Member Functions inherited from iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >
virtual T  GetPdfObject ()
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  MakeIndirect (PdfDocument document, PdfIndirectReference reference)
  Marks object behind wrapper to be saved as indirect. More...
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  MakeIndirect (PdfDocument document)
  Marks object behind wrapper to be saved as indirect. More...
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  SetModified ()
 
virtual void  Flush ()
 
virtual bool  IsFlushed ()
 
- Public Member Functions inherited from iText.Kernel.Pdf.Layer.IPdfOCG
PdfDictionary  GetPdfObject ()
  Gets the object representing the layer. More...
 

Package Functions

override bool  IsWrappedObjectMustBeIndirect ()
  Defines if the object behind this wrapper must be an indirect object in the resultant document. More...
 
virtual PdfDocument  GetDocument ()
  Gets the iText.Kernel.Pdf.PdfDocument that owns that layer membership. More...
 
- Package Functions inherited from iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >
  PdfObjectWrapper (T pdfObject)
 
virtual void  SetPdfObject (T pdfObject)
 
virtual void  SetForbidRelease ()
 
virtual void  UnsetForbidRelease ()
 
virtual void  EnsureUnderlyingObjectHasIndirectReference ()
 

Additional Inherited Members

- Static Package Functions inherited from iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >
static void  MarkObjectAsIndirect (PdfObject pdfObject)
 
static void  EnsureObjectIsAddedToDocument (PdfObject @object)
  Some wrappers use object's indirect reference to obtain the PdfDocument to which the object belongs to. More...
 

Detailed Description

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

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 iText.Kernel.Pdf.PdfObjectWrapper the iText.Kernel.Pdf.PdfObject must be indirect.

Constructor & Destructor Documentation

◆ PdfLayerMembership() [1/2]

iText.Kernel.Pdf.Layer.PdfLayerMembership.PdfLayerMembership ( PdfDocument  doc )
inline

Creates a new, empty membership layer.

Parameters
doc a iText.Kernel.Pdf.PdfDocument where a new empty membership layer creates

◆ PdfLayerMembership() [2/2]

iText.Kernel.Pdf.Layer.PdfLayerMembership.PdfLayerMembership ( PdfDictionary  membershipDictionary )
inline

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

Parameters
membershipDictionary the membership dictionary, must have an indirect reference.

Member Function Documentation

◆ AddLayer()

virtual void iText.Kernel.Pdf.Layer.PdfLayerMembership.AddLayer ( PdfLayer  layer )
inlinevirtual

Adds a new layer to the current layer membership.

Parameters
layer the layer to be added

◆ GetDocument()

virtual PdfDocument iText.Kernel.Pdf.Layer.PdfLayerMembership.GetDocument ( )
inlinepackagevirtual

Gets the iText.Kernel.Pdf.PdfDocument that owns that layer membership.

Returns
the iText.Kernel.Pdf.PdfDocument that owns that layer membership

◆ GetIndirectReference()

virtual PdfIndirectReference iText.Kernel.Pdf.Layer.PdfLayerMembership.GetIndirectReference ( )
inlinevirtual

Gets the PdfIndirectReference that represents this layer.

Returns
the PdfIndirectReference that represents this layer

Implements iText.Kernel.Pdf.Layer.IPdfOCG.

◆ GetLayers()

virtual ICollection<PdfLayer> iText.Kernel.Pdf.Layer.PdfLayerMembership.GetLayers ( )
inlinevirtual

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

Returns
list of layers this layer membership operates with

◆ GetVisibilityExpression()

virtual PdfVisibilityExpression iText.Kernel.Pdf.Layer.PdfLayerMembership.GetVisibilityExpression ( )
inlinevirtual

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

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

◆ GetVisibilityPolicy()

virtual PdfName iText.Kernel.Pdf.Layer.PdfLayerMembership.GetVisibilityPolicy ( )
inlinevirtual

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

Returns
the visibility policy for content belonging to this membership dictionary

◆ IsWrappedObjectMustBeIndirect()

override bool iText.Kernel.Pdf.Layer.PdfLayerMembership.IsWrappedObjectMustBeIndirect ( )
inlinepackagevirtual

Defines if the object behind this wrapper must be an indirect object in the resultant document.

Defines if the object behind this wrapper must be an indirect object in the resultant document.

If this method returns true it doesn't necessarily mean that object must be in the indirect state at any moment, but rather defines that when the object will be written to the document it will be transformed into indirect object if it's not indirect yet.

Return value of this method shouldn't depend on any logic, it should return always true or false.

Returns
true if in the resultant document the object behind the wrapper must be indirect, otherwise false.

Implements iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >.

◆ SetVisibilityExpression()

virtual void iText.Kernel.Pdf.Layer.PdfLayerMembership.SetVisibilityExpression ( PdfVisibilityExpression  visibilityExpression )
inlinevirtual

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

Parameters
visibilityExpression 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()

virtual void iText.Kernel.Pdf.Layer.PdfLayerMembership.SetVisibilityPolicy ( PdfName  visibilityPolicy )
inlinevirtual

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

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.

Parameters
visibilityPolicy the visibility policy