Skip to main content
A rect object describes a rectangle defined using coordinates of four lines that form its left, top, right, and bottom borders. Borders of a rectangle are always parallel to the edges of the page. The coordinates are specified in pixels. Coordinates are measured from the top-left corner of the page: the X axis increases to the right and the Y axis increases downward. Because of this, the left coordinate (l) is never greater than the right (r), and the top (t) is never greater than the bottom (b). Compute the rectangle’s width as r - l and its height as b - t.
PropertyData typeDescription
l *integerThe X coordinate of the left border of the rectangle.
t *integerThe Y coordinate of the top border of the rectangle.
r *integerThe X coordinate of the right border of the rectangle.
b *integerThe Y coordinate of the bottom border of the rectangle.
* Indicates a required property.

Example

A block positioned 120 px from the left edge and 96 px from the top, 420 px wide and 62 px tall:
{
  "l": 120,
  "t": 96,
  "r": 540,
  "b": 158
}
Pixel coordinates are relative to the page image. If the document is exported to JSON only, they refer to the original image; if it is also exported to an image format, they refer to the preprocessed image. See Pages array elements.