Class Container

java.lang.Object
com.datalogics.PDFL.Element
com.datalogics.PDFL.Container

public class Container extends Element
A container class represents a group of elements on a page in a PDF file. In the PDF file, every container has a set of Marked Content tags, starting with Begin Marked Content (BMC or BDC) and ending with End Marked Content (EMC), so each container has a BMC/EMC or BDC/EMC pair of tags. These tags can be used to define the beginning and end of metadata around objects, providing information about the text and shapes within a PDF file. Containers can be nested within other containers.
  • Constructor Details

    • Container

      public Container()
      Create a new Container.

      The new Container has no tag and is not associated with a dictionary.

    • Container

      public Container(String mcTag)
      Create a new Container with a given Marked Content Tag.

      The new Container has a Marked Content tag but is not associated with a dictionary.

    • Container

      public Container(String mcTag, PDFDict propertyList, boolean isInline)
      Create a new Container with a given Marked Content Tag and Property list.

      The new Container has a Marked Content tag and is associated with a dictionary.

      Parameters:
      propertyList - The tag name for the Container.
      isInline - If true, it's part of content stream. If false, its emitted outside of the content stream and referenced by name.
      propertyList - The dictionary representing the Property List to associate with the Container.
  • Method Details

    • delete

      public void delete()
      Overrides:
      delete in class Element
    • getMarkedContentTag

      public String getMarkedContentTag()
      The container's Marked Content Tag.

    • setMarkedContentTag

      public void setMarkedContentTag(String mcTag)
      The container's Marked Content Tag.

    • getContent

      public Content getContent()
      Obtain the content of a container.

    • setContent

      public void setContent(Content content)
      Set the content of a container.

      Parameters:
      content - The new Content of the container.
    • clone

      public Container clone()
      Makes a copy of the container.

      Make a copy of an container to obtain a new container that has a distinct set of attributes.

      Overrides:
      clone in class Element
      Returns:
      The copied container.
    • clone

      public Container clone(EnumSet<ElementCloneFlags> cloneFlags)
      Makes a copy of the container.

      Make a copy of an container to obtain a new container that has a distinct set of attributes.

      Overrides:
      clone in class Element
      Parameters:
      cloneFlags - Flags that modify the cloning operation.
      Returns:
      The copied container.
    • getOptionalContentMembershipDict

      public OptionalContentMembershipDict getOptionalContentMembershipDict()
      The OptionalContentMembershipDict property for this Container.

      Setting this property will attach the Container to an OptionalContentMembershipDict; it will then be associated with the OptionalContentGroups and be subject to the VisibilityPolicy and VisibilityExpression of that MembershipDict.

      By setting this property to null, the Container is detached from any OptionalContentMembershipDict.

      Returns:
      the OptionalContentMembershipDict
    • setOptionalContentMembershipDict

      public void setOptionalContentMembershipDict(OptionalContentMembershipDict ocmd)
      The OptionalContentMembershipDict property for this Container.

      Setting this property will attach the Container to an OptionalContentMembershipDict; it will then be associated with the OptionalContentGroups and be subject to the VisibilityPolicy and VisibilityExpression of that MembershipDict.

      By setting this property to null, the Container is detached from any OptionalContentMembershipDict.

      Parameters:
      ocmd - the OptionalContentMembershipDict
    • isCurrentlyVisible

      public boolean isCurrentlyVisible(OptionalContentContext occ)
      Tests whether a container is visible in a given optional content context, considering the current ON-OFF states of the optional-content groups in the optional-content dictionary (OCMD) and the dictionary's visibility policy.

      If the container occurs more than once within the content, this method only checks the visibility of the first occurrence of the container.

      This method determines visibility without considering the visbility of the Content object that the container belongs to. To determine the visibility of a container while taking the Content's visibility into consideration, use the alternate version of this method.

      Returns:
      true if the container is currently visible.
    • isCurrentlyVisible

      public boolean isCurrentlyVisible(OptionalContentContext occ, Content content)
      Tests whether a container is visible in a given optional content context and content.

      If the container occurs more than once within the content, this method only checks the visibility of the first occurrence of the container.

      Returns:
      true if the container is currently visible.
    • makeVisible

      public boolean makeVisible(OptionalContentContext occ, Content content)
      Makes a container visible in a given optional content context and content by manipulating the ON-OFF states of the optional content groups.

      Parameters:
      occ - The optional content context in which the container is made visible.
      content - The content containing the container.
      Returns:
      true if the container is successfully made visible in the given context and content, false otherwise
    • colorConvert

      public Container colorConvert(Document document, ColorProfile prof, RenderIntent intent, boolean embed)
      Applies the specified ICC ColorProfile to the objects in the Container

      Parameters:
      document - The document the element belongs to.
      prof - The ICC ColorProfile to be applied.
      intent - The ICC Rendering Intent for the ColorProfile
      embed - If true, embed the color space and make the objects calibrated. If it is false and the target profile is CMYK, RGB, or Gray, the colors space of the resulting objects, after conversion, will be DeviceCMYK, DeviceRGB, or DeviceGray, respectively.
      Returns:
      A new Container with the applied ICC ColorProfile.
    • getPDFDict

      public PDFDict getPDFDict()
      Retrieve the PDFObject representation of this object