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

This class represents /OCProperties entry if pdf catalog and manages the layers of the pdf document. More...

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

Public Member Functions

  PdfOCProperties (PdfDocument document)
  Creates a new PdfOCProperties instance. More...
 
  PdfOCProperties (PdfDictionary ocPropertiesDict)
  Creates a new PdfOCProperties instance by the dictionary it represents, the dictionary must be an indirect object. More...
 
virtual void  AddOCGRadioGroup (IList< PdfLayer > group)
  Use this method to set a collection of optional content groups whose states are intended to follow a "radio button" paradigm. More...
 
virtual PdfObject  FillDictionary ()
  Fills the underlying PdfDictionary object with the current layers and their settings. More...
 
virtual PdfObject  FillDictionary (bool removeNonDocumentOcgs)
  Fills the underlying PdfDictionary object with the current layers and their settings. More...
 
override void  Flush ()
 
virtual IList< PdfLayer GetLayers ()
  Gets the list of all the layers currently registered in the OCProperties. 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 bool  IsFlushed ()
 

Static Public Member Functions

static bool  CheckDDictonaryFieldValue (PdfName field, PdfObject value)
  Checks if optional content group default configuration dictionary field value matches the required value for this field, if one exists. More...
 

Package Functions

override bool  IsWrappedObjectMustBeIndirect ()
  Defines if the object behind this wrapper must be an indirect object in the resultant document. More...
 
virtual void  RegisterLayer (PdfLayer layer)
  This method registers a new layer in the OCProperties. More...
 
virtual PdfDocument  GetDocument ()
  Gets the iText.Kernel.Pdf.PdfDocument that owns that OCProperties. 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

This class represents /OCProperties entry if pdf catalog and manages the layers of the pdf document.

This class represents /OCProperties entry if pdf catalog and manages the layers of the pdf document.

To be able to be wrapped with this iText.Kernel.Pdf.PdfObjectWrapper the iText.Kernel.Pdf.PdfObject must be indirect.

Constructor & Destructor Documentation

◆ PdfOCProperties() [1/2]

iText.Kernel.Pdf.Layer.PdfOCProperties.PdfOCProperties ( PdfDocument  document )
inline

Creates a new PdfOCProperties instance.

Parameters
document the document the optional content belongs to

◆ PdfOCProperties() [2/2]

iText.Kernel.Pdf.Layer.PdfOCProperties.PdfOCProperties ( PdfDictionary  ocPropertiesDict )
inline

Creates a new PdfOCProperties instance by the dictionary it represents, the dictionary must be an indirect object.

Parameters
ocPropertiesDict the dictionary of optional content properties, must have an indirect reference.

Member Function Documentation

◆ AddOCGRadioGroup()

virtual void iText.Kernel.Pdf.Layer.PdfOCProperties.AddOCGRadioGroup ( IList< PdfLayer group )
inlinevirtual

Use this method to set a collection of optional content groups whose states are intended to follow a "radio button" paradigm.

Use this method to set a collection of optional content groups whose states are intended to follow a "radio button" paradigm. That is, the state of at most one optional content group in the array should be ON at a time: if one group is turned ON, all others must be turned OFF.

Parameters
group the radio group

◆ CheckDDictonaryFieldValue()

static bool iText.Kernel.Pdf.Layer.PdfOCProperties.CheckDDictonaryFieldValue ( PdfName  field,
PdfObject  value 
)
inlinestatic

Checks if optional content group default configuration dictionary field value matches the required value for this field, if one exists.

Parameters
field default configuration dictionary field.
value value of that field.
Returns
boolean indicating if field meets requirement.

◆ FillDictionary() [1/2]

virtual PdfObject iText.Kernel.Pdf.Layer.PdfOCProperties.FillDictionary ( )
inlinevirtual

Fills the underlying PdfDictionary object with the current layers and their settings.

Fills the underlying PdfDictionary object with the current layers and their settings. Note that it completely regenerates the dictionary, so your direct changes to the dictionary will not take any affect.

Returns
the resultant dictionary

◆ FillDictionary() [2/2]

virtual PdfObject iText.Kernel.Pdf.Layer.PdfOCProperties.FillDictionary ( bool  removeNonDocumentOcgs )
inlinevirtual

Fills the underlying PdfDictionary object with the current layers and their settings.

Fills the underlying PdfDictionary object with the current layers and their settings. Note that it completely regenerates the dictionary, so your direct changes to the dictionary will not take any affect.

Parameters
removeNonDocumentOcgs the flag indicating whether it is necessary to delete OCGs not from the current document
Returns
the resultant dictionary

◆ GetDocument()

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

Gets the iText.Kernel.Pdf.PdfDocument that owns that OCProperties.

Returns
the iText.Kernel.Pdf.PdfDocument that owns that OCProperties

◆ GetLayers()

virtual IList<PdfLayer> iText.Kernel.Pdf.Layer.PdfOCProperties.GetLayers ( )
inlinevirtual

Gets the list of all the layers currently registered in the OCProperties.

Gets the list of all the layers currently registered in the OCProperties. Note that this is just a new list and modifications to it will not affect anything.

Returns
list of all the layers currently registered in the OCProperties

◆ IsWrappedObjectMustBeIndirect()

override bool iText.Kernel.Pdf.Layer.PdfOCProperties.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 >.

◆ RegisterLayer()

virtual void iText.Kernel.Pdf.Layer.PdfOCProperties.RegisterLayer ( PdfLayer  layer )
inlinepackagevirtual

This method registers a new layer in the OCProperties.

Parameters
layer the new layer