Class Clip

java.lang.Object
com.datalogics.PDFL.Clip

public class Clip extends Object
A clipping path is used to mark an area within a page to be highlighted or removed. The clipping path clips out part of the design. A clip can also be used with text.

The clipping path defines an area within a page (text or graphic) that will be highlighted or removed. For example, a clipping path could be used to remove the background in a photograph, to highlight a person or object in front, or to super-impose text over an image. Only part of the image appears through a shape created with the clipping path.

The Clip class is made up of a list of path and text elements. Any element can have a clip associated with it, and clip objects can hold arbitrary levels of nested container and group objects.

If a group object is inside a clip object, and the clip object also contains at least one text object and no path objects, the group object has a special meaning. All text objects contained in a group object like this are considered to be part of the same BT/ET block. This means that the union of these text objects makes up a single clipping path. The text objects do not intersect.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an empty Clip object.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds an Element to a Clip path as the first indexed Element.
    void
    addElement(Element element, int addAfterIndex)
    Adds an Element to a Clip path, after the Element index specified.
    Makes a new deep copy of this Clip object in memory.
    void
     
    getElement(int index)
    Gets an Element from a Clip path.
    int
    Gets the number of top-level Elements in a Clip object.
    void
    removeElements(int index)
    Removes an Element from a Clip object.
    void
    removeElements(int index, int count)
    Removes one or more Elements from a Clip object.
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Clip

      public Clip()
      Creates an empty Clip object. This represents a clipping object that has no effect on elements that refer to it.

  • Method Details

    • delete

      public void delete()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public Clip clone()
      Makes a new deep copy of this Clip object in memory.

      Returns:
      A new clip object deep copy
    • addElement

      public void addElement(Element element, int addAfterIndex)
      Adds an Element to a Clip path, after the Element index specified.

      Parameters:
      element - The Element to add to the Clip.
      addAfterIndex - The index after which this Element will be added to the Clip's list of Elements. If omitted, it will be added as index 0, i.e., the first Element.
    • addElement

      public void addElement(Element element)
      Adds an Element to a Clip path as the first indexed Element.

      Parameters:
      element - The Element to add to the Clip.
    • getElement

      public Element getElement(int index)
      Gets an Element from a Clip path.

      Parameters:
      index - The index of the desired Element.
      Returns:
      - The Element found at the supplied index in the Clip's Element list.
    • numElements

      public int numElements()
      Gets the number of top-level Elements in a Clip object.

      Returns:
      - The number of top-level Elements in the Clip.
    • removeElements

      public void removeElements(int index)
      Removes an Element from a Clip object.

      Parameters:
      index - The index of the Element to remove.
    • removeElements

      public void removeElements(int index, int count)
      Removes one or more Elements from a Clip object.

      Parameters:
      index - The index of the first Element to remove.
      count - The number of Elements to remove, starting with the index Element.