Class PdfOCProperties
This class represents /OCProperties entry if pdf catalog and manages the layers of the pdf document.
public class PdfOCProperties : PdfObjectWrapper<PdfDictionary>
- Inheritance
-
PdfOCProperties
- Inherited Members
Remarks
This class represents /OCProperties entry if pdf catalog and manages the layers of the pdf document.
To be able to be wrapped with this PdfObjectWrapper<T> the PdfObject must be indirect.Constructors
PdfOCProperties(PdfDictionary)
Creates a new PdfOCProperties instance by the dictionary it represents, the dictionary must be an indirect object.
public PdfOCProperties(PdfDictionary ocPropertiesDict)
Parameters
ocPropertiesDict
PdfDictionarythe dictionary of optional content properties, must have an indirect reference.
PdfOCProperties(PdfDocument)
Creates a new PdfOCProperties instance.
public PdfOCProperties(PdfDocument document)
Parameters
document
PdfDocumentthe document the optional content belongs to
Methods
AddOCGRadioGroup(IList<PdfLayer>)
Use this method to set a collection of optional content groups whose states are intended to follow a "radio button" paradigm.
public virtual void AddOCGRadioGroup(IList<PdfLayer> group)
Parameters
Remarks
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.
CheckDDictonaryFieldValue(PdfName, PdfObject)
Checks if optional content group default configuration dictionary field value matches the required value for this field, if one exists.
public static bool CheckDDictonaryFieldValue(PdfName field, PdfObject value)
Parameters
Returns
- bool
boolean indicating if field meets requirement.
FillDictionary()
Fills the underlying PdfDictionary object with the current layers and their settings.
public virtual PdfObject FillDictionary()
Returns
- PdfObject
the resultant dictionary
Remarks
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.
FillDictionary(bool)
Fills the underlying PdfDictionary object with the current layers and their settings.
public virtual PdfObject FillDictionary(bool removeNonDocumentOcgs)
Parameters
removeNonDocumentOcgs
boolthe flag indicating whether it is necessary to delete OCGs not from the current document
Returns
- PdfObject
the resultant dictionary
Remarks
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.
Flush()
public override void Flush()
GetDocument()
Gets the PdfDocument that owns that OCProperties.
protected virtual PdfDocument GetDocument()
Returns
- PdfDocument
the PdfDocument that owns that OCProperties
GetLayers()
Gets the list of all the layers currently registered in the OCProperties.
public virtual IList<PdfLayer> GetLayers()
Returns
Remarks
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.
IsWrappedObjectMustBeIndirect()
protected override bool IsWrappedObjectMustBeIndirect()
Returns
RegisterLayer(PdfLayer)
This method registers a new layer in the OCProperties.
protected virtual void RegisterLayer(PdfLayer layer)
Parameters
layer
PdfLayerthe new layer