class HexaPDF::Rectangle


Implementation of the PDF rectangle data structure.

Rectangles are used for describing page and bounding boxes. They are represented by arrays of four numbers specifying the (x,y) coordinates of any diagonally opposite corners.

This class simplifies the usage of rectangles by automatically normalizing the coordinates so that they are in the order:

[left, bottom, right, top]

where left is the bottom left x-coordinate, bottom is the bottom left y-coordinate, right is the top right x-coordinate and top is the top right y-coordinate.

See: PDF1.7 s7.9.5

Public Instance Methods


Compares this rectangle to other like in Object#== but also allows comparison to simple arrays if the rectangle is a direct object.

Calls superclass method HexaPDF::Object#==

Returns the y-coordinate of the bottom-left corner.


Returns the height of the rectangle.


Returns the x-coordinate of the bottom-left corner.


Returns the x-coordinate of the top-right corner.


Returns the y-coordinate of the top-right corner.


Returns the width of the rectangle.