Class PdfRectangle


public class PdfRectangle extends PdfArray
PdfRectangle is the PDF Rectangle object.

Rectangles are used to describe locations on the page and bounding boxes for several objects in PDF, such as fonts. A rectangle is represented as an array of four numbers, specifying the lower left x, lower left y, upper right x, and upper right y coordinates of the rectangle, in that order.
This object is described in the 'Portable Document Format Reference Manual version 1.3' section 7.1 (page 183).

See Also:
  • Constructor Details

    • PdfRectangle

      public PdfRectangle(float llx, float lly, float urx, float ury, int rotation)
      Constructs a PdfRectangle-object.
      Parameters:
      llx - lower left x
      lly - lower left y
      urx - upper right x
      ury - upper right y
      rotation - the rotation angle
      Since:
      rugPdf0.10
    • PdfRectangle

      public PdfRectangle(float llx, float lly, float urx, float ury)
    • PdfRectangle

      public PdfRectangle(Rectangle rectangle, int rotation)
      Constructs a PdfRectangle-object with a Rectangle-object.
      Parameters:
      rectangle - a Rectangle
      rotation - the rotation angle
    • PdfRectangle

      public PdfRectangle(Rectangle rectangle)
  • Method Details

    • add

      public boolean add(PdfObject object)
      Overrides the add-method in PdfArray in order to prevent the adding of extra object to the array.
      Overrides:
      add in class PdfArray
      Parameters:
      object - PdfObject to add (will not be added here)
      Returns:
      false
    • add

      public boolean add(int[] values)
      Block changes to the underlying PdfArray
      Overrides:
      add in class PdfArray
      Parameters:
      values - stuff we'll ignore. Ha!
      Returns:
      false. You can't add anything to a PdfRectangle
      Since:
      2.1.5
    • left

      public float left()
      Returns the lower left x-coordinate.
      Returns:
      the lower left x-coordinate
    • right

      public float right()
      Returns the upper right x-coordinate.
      Returns:
      the upper right x-coordinate
    • top

      public float top()
      Returns the upper right y-coordinate.
      Returns:
      the upper right y-coordinate
    • bottom

      public float bottom()
      Returns the lower left y-coordinate.
      Returns:
      the lower left y-coordinate