Stay organized with collections
Save and categorize content based on your preferences.
A region classifier specifies the format and location for an object. A
classifier might be a 2-dimensional rectangle for an image, a line of text in a
document, a time duration in a video, and so on. To define a region, select the
region classifier that matches the type of content you're trying to use. For
example, if your content is text, you're likely going to use either the txt
or line region classifier. To see an example of a region classifier, see
Manage comments and
replies.
The following is a list of the region classifiers included with the
Google Drive API:
rect
A rectangle in a 2-dimensional image.
Property
Description
Type
x
Position on the x axis, units default to pixels for images and percent for PDFs.
Double
y
Position on the y axis, units default to pixels for images and percent for PDFs.
Double
w
Length on the x axis, units default to pixels for images and percent for PDFs.
Double
h
Length on the y axis, units default to pixels for images and percent for PDFs.
Double
mw
The full width of the document when the comment was made. Use this to make x and w unitless since they can act like a percentage.
Double
mh
The full height of the document when the comment was made. See mw above for purpose.
Double
r
The degrees of rotation of the document. For example, if an image is rotated 90 degrees clockwise then a rectangle at 0,0 displays in the top right of the image. Should be one of 0, 90, 180, 270.
Double
page
A page number in a PDF, TIFF, or other document with pages. Use this for documents with page-like elements (such as a spreadsheet, slide, or layer).
Property
Description
Type
p
The page number (0-indexed).
Integer
mp
The number of pages in this document.
Integer
time
A duration of time in a video or other document with a time dimension.
Property
Description
Type
t
The start time.
hh:MM:ss.frac formatted time string (where M = minutes, m = millis; hours and minutes are optional)
d
The duration of the time range.
hh:MM:ss:mmm formatted time string (where M = minutes, m = millis)
md
The full-time duration of the document.
hh:MM:ss:mmm formatted time string (where M = minutes, m = millis)
txt
A range of text in a document.
Property
Description
Type
o
Start offset (character offset from the start of the file).
Integer
l
The length of the text range.
Integer
ml
The length of this document in characters.
Integer
line
A specific line in a text file or any files with lines in it.
Property
Description
Type
n
Line number.
Integer
l
The length of the line range.
Integer
ml
The maximum number of lines in the file.
Integer
matrix
A location in a matrix-like structure. Used to define rows and columns in spreadsheet documents, or any other documents that have a row or column structure.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-18 UTC."],[],[],null,["# Region classifiers\n\nA region classifier specifies the format and location for an object. A\nclassifier might be a 2-dimensional rectangle for an image, a line of text in a\ndocument, a time duration in a video, and so on. To define a region, select the\nregion classifier that matches the type of content you're trying to use. For\nexample, if your content is text, you're likely going to use either the `txt`\nor `line` region classifier. To see an example of a region classifier, see\n[Manage comments and\nreplies](https://developers.google.com/workspace/drive/api/guides/manage-comments#define).\n\nThe following is a list of the region classifiers included with the\nGoogle Drive API:\n\n`rect`\n\n: A rectangle in a 2-dimensional image.\n\n | Property | Description | Type |\n |----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|\n | `x` | Position on the x axis, units default to pixels for images and percent for PDFs. | Double |\n | `y` | Position on the y axis, units default to pixels for images and percent for PDFs. | Double |\n | `w` | Length on the x axis, units default to pixels for images and percent for PDFs. | Double |\n | `h` | Length on the y axis, units default to pixels for images and percent for PDFs. | Double |\n | `mw` | The full width of the document when the comment was made. Use this to make `x` and `w` unitless since they can act like a percentage. | Double |\n | `mh` | The full height of the document when the comment was made. See `mw` above for purpose. | Double |\n | `r` | The degrees of rotation of the document. For example, if an image is rotated 90 degrees clockwise then a rectangle at 0,0 displays in the top right of the image. Should be one of 0, 90, 180, 270. | Double |\n\n`page`\n\n: A page number in a PDF, TIFF, or other document with pages. Use this for documents with page-like elements (such as a spreadsheet, slide, or layer).\n\n | Property | Description | Type |\n |----------|---------------------------------------|---------|\n | `p` | The page number (0-indexed). | Integer |\n | `mp` | The number of pages in this document. | Integer |\n\n`time`\n\n: A duration of time in a video or other document with a time dimension.\n\n | Property | Description | Type |\n |----------|-----------------------------------------|-------------------------------------------------------------------------------------------------------|\n | `t` | The start time. | `hh:MM:ss.frac` formatted time string (where M = minutes, m = millis; hours and minutes are optional) |\n | `d` | The duration of the time range. | `hh:MM:ss:mmm` formatted time string (where M = minutes, m = millis) |\n | `md` | The full-time duration of the document. | `hh:MM:ss:mmm` formatted time string (where M = minutes, m = millis) |\n\n`txt`\n\n: A range of text in a document.\n\n | Property | Description | Type |\n |----------|-------------------------------------------------------------|---------|\n | `o` | Start offset (character offset from the start of the file). | Integer |\n | `l` | The length of the text range. | Integer |\n | `ml` | The length of this document in characters. | Integer |\n\n`line`\n\n: A specific line in a text file or any files with lines in it.\n\n | Property | Description | Type |\n |----------|------------------------------------------|---------|\n | `n` | Line number. | Integer |\n | `l` | The length of the line range. | Integer |\n | `ml` | The maximum number of lines in the file. | Integer |\n\n`matrix`\n\n: A location in a matrix-like structure. Used to define rows and columns in spreadsheet documents, or any other documents that have a row or column structure.\n\n | Property | Description | Type |\n |----------|------------------------|---------|\n | `c` | The column number. | Integer |\n | `r` | The row number. | Integer |\n | `w` | The number of columns. | Integer |\n | `h` | The number of rows. | Integer |\n | `mw` | The maximum width. | Integer |\n | `mh` | The maximum height. | Integer |"]]