The RectangleObject Class

class pypdf.generic.RectangleObject(arr: Union[RectangleObject, Tuple[float, float, float, float]])[source]

Bases: ArrayObject

This class is used to represent page boxes in pypdf.

These boxes include:

scale(sx: float, sy: float) RectangleObject[source]
ensureIsNumber(value: Any) Union[FloatObject, NumberObject][source]
property left: pypdf.generic._base.FloatObject
property bottom: pypdf.generic._base.FloatObject
property right: pypdf.generic._base.FloatObject
property top: pypdf.generic._base.FloatObject
getLowerLeft_x() FloatObject[source]
getLowerLeft_y() FloatObject[source]
getUpperRight_x() FloatObject[source]
getUpperRight_y() FloatObject[source]
getUpperLeft_x() FloatObject[source]
getUpperLeft_y() FloatObject[source]
getLowerRight_x() FloatObject[source]
getLowerRight_y() FloatObject[source]
property lower_left: Tuple[float, float]

Property to read and modify the lower left coordinate of this box in (x,y) form.

property lower_right: Tuple[float, float]

Property to read and modify the lower right coordinate of this box in (x,y) form.

property upper_left: Tuple[float, float]

Property to read and modify the upper left coordinate of this box in (x,y) form.

property upper_right: Tuple[float, float]

Property to read and modify the upper right coordinate of this box in (x,y) form.

getLowerLeft() Tuple[float, float][source]
getLowerRight() Tuple[float, float][source]
getUpperLeft() Tuple[float, float][source]
getUpperRight() Tuple[float, float][source]
setLowerLeft(value: Tuple[float, float]) None[source]
setLowerRight(value: Tuple[float, float]) None[source]
setUpperLeft(value: Tuple[float, float]) None[source]
setUpperRight(value: Tuple[float, float]) None[source]
property width: float
indirect_reference: Optional[IndirectObject]
getWidth() float[source]
property height: float
getHeight() float[source]
property lowerLeft: Tuple[float, float]
property lowerRight: Tuple[float, float]
property upperLeft: Tuple[float, float]
property upperRight: Tuple[float, float]