Package com.datalogics.PDFL
Class OptionalContentContext
java.lang.Object
com.datalogics.PDFL.OptionalContentContext
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.
-
Constructor Summary
ConstructorsConstructorDescriptionOptionalContentContext(Document document) 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. -
Method Summary
Modifier and TypeMethodDescriptionclone()Makes a copy of the optional content context.voiddelete()booleanGets the drawing policy for the optional content in this optional content context.getOCGStates(List<OptionalContentGroup> ocgs) Gets the ON-OFF states for the given optional-content groups (OCGs) in the given optional-content context.booleanGets the ON-OFF state for the given optional content group (OCG) in this optional content context.voidSets the drawing policy for the optional content in this optional content context.voidsetOCGStates(List<OptionalContentGroup> ocgs, List<Boolean> newStates) Sets the ON-OFF states for the given optional-content groups (OCGs) in the given optional-content context.voidsetStateOfOCG(OptionalContentGroup ocg, boolean newValue) Sets the ON-OFF state for the given optional content group (OCG) in this optional content context.toString()
-
Constructor Details
-
OptionalContentContext
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.- Parameters:
document- The document for which to create a context.
-
-
Method Details
-
delete
public void delete() -
equals
-
getOCGStates
Gets the ON-OFF states for the given optional-content groups (OCGs) in the given optional-content context.- Parameters:
ocgs- A list of optional-content groups whose states are obtained.- Returns:
- An array of OCG states corresponding to the array of OCGs, true for ON and false for OFF.
-
setOCGStates
Sets 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.- Parameters:
ocgs- A list of optional-content groups.newStates- 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.
-
getStateOfOCG
Gets the ON-OFF state for the given optional content group (OCG) in this optional content context.- Parameters:
ocg- The optional content group whose state will be retrieved.
-
setStateOfOCG
Sets the ON-OFF state for the given optional content group (OCG) in this optional content context.- Parameters:
ocg- The optional content group whose state will be set.newValue- The new ON-OFF state for the optional content group.
-
clone
Makes a copy of the optional content context.- Returns:
- A copy of the original optional content context.
-
toString
-
getDrawOptionalContent
Gets the drawing policy for the optional content in this optional content context.- Returns:
- The drawing policy for optional content in this optional content context.
-
setDrawOptionalContent
Sets the drawing policy for the optional content in this optional content context.- Parameters:
newPolicy- The new drawing policy for optional content in this optional content context.
-