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 booleandependsOn(OptionalContentGroup ocg)Checks if the content element depends on a giventoolbox.pdf.OptionalContentGroup.java.lang.StringgetExpression()The content element visibility function.booleangetIsVisible()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 giventoolbox.pdf.OptionalContentGroup.- Parameters:
ocg- The optional content group to be checked.- Returns:
- Throws:
java.lang.IllegalArgumentException- ifocgisnull
-
getIsVisible
public boolean getIsVisible()
The element visibility. (Getter)
trueif the element is visible in the default configuration ortoolbox.pdf.Document.getOptionalContentGroupsis 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 retrieved 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
-
-