Module org.sejda.sambox
Class PDOptionalContentProperties
java.lang.Object
org.sejda.sambox.pdmodel.common.PDDictionaryWrapper
org.sejda.sambox.pdmodel.graphics.optionalcontent.PDOptionalContentProperties
- All Implemented Interfaces:
COSObjectable
This class represents the optional content properties dictionary.
- Since:
- PDF 1.5
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration for the BaseState dictionary entry on the "D" dictionary. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new optional content properties dictionary.Creates a new instance based on a givenCOSDictionary. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an optional content group (OCG).Returns the base state for optional content groups.Returns the optional content group of the given name.String[]Lists all optional content group names.Returns the collection of all optional content groups.booleanIndicates whether a particular optional content group is found in the PDF file.booleanisGroupEnabled(String groupName) Indicates whether an optional content group is enabled.booleanIndicates whether an optional content group is enabled.voidSets the base state for optional content groups.booleansetGroupEnabled(String groupName, boolean enable) Enables or disables an optional content group.booleansetGroupEnabled(PDOptionalContentGroup group, boolean enable) Enables or disables an optional content group.Methods inherited from class org.sejda.sambox.pdmodel.common.PDDictionaryWrapper
equals, getCOSObject, hashCode
-
Constructor Details
-
PDOptionalContentProperties
public PDOptionalContentProperties()Creates a new optional content properties dictionary. -
PDOptionalContentProperties
Creates a new instance based on a givenCOSDictionary.- Parameters:
props- the dictionary
-
-
Method Details
-
getGroup
Returns the optional content group of the given name.- Parameters:
name- the group name- Returns:
- the optional content group or null, if there is no such group
-
addGroup
Adds an optional content group (OCG).- Parameters:
ocg- the optional content group
-
getOptionalContentGroups
Returns the collection of all optional content groups.- Returns:
- the optional content groups
-
getBaseState
Returns the base state for optional content groups.- Returns:
- the base state
-
setBaseState
Sets the base state for optional content groups.- Parameters:
state- the base state
-
getGroupNames
Lists all optional content group names.- Returns:
- an array of all names
-
hasGroup
Indicates whether a particular optional content group is found in the PDF file.- Parameters:
groupName- the group name- Returns:
- true if the group exists, false otherwise
-
isGroupEnabled
Indicates whether an optional content group is enabled.- Parameters:
groupName- the group name- Returns:
- true if the group is enabled
-
isGroupEnabled
Indicates whether an optional content group is enabled.- Parameters:
group- the group object- Returns:
- true if the group is enabled
-
setGroupEnabled
Enables or disables an optional content group.- Parameters:
groupName- the group nameenable- true to enable, false to disable- Returns:
- true if the group already had an on or off setting, false otherwise
-
setGroupEnabled
Enables or disables an optional content group.- Parameters:
group- the group objectenable- true to enable, false to disable- Returns:
- true if the group already had an on or off setting, false otherwise
-