Class OptionalContentMembership


  • public class OptionalContentMembership
    extends NativeObject
    • 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 - if ocg is null
      • getIsVisible

        public boolean getIsVisible()

        The element visibility. (Getter)

        true if the element is visible in the default configuration or toolbox.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