Package com.pdftools.toolbox.pdf.content
Class OptionalContentMembership
- java.lang.Object
-
- com.pdftools.toolbox.internal.NativeBase
-
- com.pdftools.toolbox.internal.NativeObject
-
- com.pdftools.toolbox.pdf.content.OptionalContentMembership
-
public class OptionalContentMembership extends NativeObject
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
dependsOn(OptionalContentGroup ocg)
Checks if the content element depends on a given OCG.java.lang.String
getExpression()
The content element visibility function.boolean
getIsVisible()
The element visibility.-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
dependsOn
public boolean dependsOn(OptionalContentGroup ocg)
Checks if the content element depends on a given OCG.- Parameters:
ocg
- The optional content group to be checked.- Returns:
- Throws:
java.lang.IllegalArgumentException
- ifocg
isnull
-
getIsVisible
public boolean getIsVisible()
The element visibility. (Getter)
true
if the element is visible in the default configuration ortoolbox.pdf.Document.getOptionalContentGroups
is empty.false
, otherwise.- Throws:
java.lang.IllegalStateException
- the object has already been closed
-
getExpression
public java.lang.String getExpression()
The content element visibility function. (Getter)
Optional content membership expression defines the visibility as a boolean function of OCG indices in C syntax. The OCG index represents the position of the element in the OCG list which can be retreived by using
toolbox.pdf.Document.getOptionalContentGroups
. Example: "1 || 2" means that the content element is visible if either OCG 1 or OCG 2 is ON.Alternatively, the evaluated expression can be fetched via
getIsVisible()
.- Throws:
java.lang.IllegalStateException
- the object has already been closed
-
-