OptionalContentContext Class Documentation
class OptionalContentContext : SystemIDisposableNamespace:Datalogics::PDFL
- Inherits from:
SystemIDisposable
Detailed Description
Defines the context for optional content in a PDF.
An Optional Content Context is a status object that defines the context for optional content within a document.
The context tracks the On/Off status for Optional Content Groups (layers) within a document. It contains flags that control whether to display content that is marked as optional.
Referenced by
Constructor & Destructor Documentation
OptionalContentContext
OptionalContentContext(Document document)Parameters
document: DocumentThe document for which to create a context.
Creates a context object that represents an optional-content state of the document, using the current state as the initial state for each group (OCG), as determined by the document's optional-content configuration.
Property Documentation
DrawOptionalContent
OptionalContentDrawingPolicy DrawOptionalContent[get, set]Gets the drawing policy for the optional content in this optional content context.
Member Function Documentation
Clone
OptionalContentContext Clone()Returns:
OptionalContentContextA copy of the original optional content context.
Makes a copy of the optional content context.
Dispose
void Dispose()Returns:
voidEquals
override bool Equals(object obj)Parameters
obj: object
Returns:
override boolGetOCGStates
System.Collections.Generic.IList< System.Boolean > GetOCGStates(System.Collections.Generic.IList< OptionalContentGroup > ocgs)Parameters
ocgs: System.Collections.Generic.IList< OptionalContentGroup >A list of optional-content groups whose states are obtained.
Returns:
System.Collections.Generic.IList< System.Boolean >An array of OCG states corresponding to the array of OCGs, true for ON and false for OFF.
Gets the ON-OFF states for the given optional-content groups (OCGs) in the given optional-content context.
GetStateOfOCG
bool GetStateOfOCG(OptionalContentGroup ocg)Parameters
ocg: OptionalContentGroupThe optional content group whose state will be retrieved.
Returns:
booltrue if the OCG is ON, false if it is OFF.
Gets the ON-OFF state for the given optional content group (OCG) in this optional content context.
SetOCGStates
void SetOCGStates(System.Collections.Generic.IList< OptionalContentGroup > ocgs, System.Collections.Generic.IList< System.Boolean > newStates)Parameters
ocgs: System.Collections.Generic.IList< OptionalContentGroup >A list of optional-content groups.
newStates: System.Collections.Generic.IList< System.Boolean >A list of new OCG states corresponding to the list of OCGs, true for ON and false for OFF. The list must contain as many states as there are non-NULL OCGs in the pdocgs list.
Returns:
voidSets the ON-OFF states for the given optional-content groups (OCGs) in the given optional-content context. The newStates vector must be large enough to hold as many Boolean values as there are OCGs.
SetStateOfOCG
void SetStateOfOCG(OptionalContentGroup ocg, bool newValue)Parameters
ocg: OptionalContentGroupThe optional content group whose state will be set.
newValue: boolThe new ON-OFF state for the optional content group.
Returns:
voidSets the ON-OFF state for the given optional content group (OCG) in this optional content context.
ToString
override string ToString()Returns:
override stringA string describing the state of all optional content groups in this context.
Returns a string representation of this OptionalContentContext.
The string lists all optional content groups in the document along with their ON/OFF states in this context.