Class XObject

java.lang.Object
org.jpedal.constants.XObject

public final class XObject extends Object
Represents a basic Form XObject.
  • Constructor Details

    • XObject

      public XObject(float[] boundingBox)
      Create a new Form XObject.
      Parameters:
      boundingBox - An array of four numbers in the form coordinate system giving the coordinates of the left, bottom, right, and top edges, respectively, of the form XObject’s bounding box.
    • XObject

      public XObject(float[] boundingBox, float[] matrix)
      Create a new Form XObject.
      Parameters:
      boundingBox - An array of four numbers in the form coordinate system giving the coordinates of the left, bottom, right, and top edges, respectively, of the form XObject’s bounding box.
      matrix - An array of six numbers specifying the form matrix, which maps form space into user space.
  • Method Details

    • draw

      public XObject draw(String commands)
      Write stream drawing commands to this XObject
      Parameters:
      commands - the commands to write
      Returns:
      a reference to this XObject
    • withParameters

      public XObject withParameters(DrawParameters drawParameters)
      Add extended graphics state parameters using a DrawParameters object.

      This will insert the gs command at the point where you call it, therefore you should use it near the beginning of the constructed stream, just after the q command.

      You may call this method more than once with different or the same draw parameters. Identical draw parameters are cached so that the minimal amount of dictionaries are created.

      Parameters:
      drawParameters - the drawing parameters for this XObject
      Returns:
      a reference to this XObject