Эта служба позволяет сценариям создавать, получать доступ и изменять файлы Google Docs.
// Open a document by ID.
var doc = DocumentApp.openById('DOCUMENT_ID_GOES_HERE');
// Create and open a document.
doc = DocumentApp.create('Document Name');
Классы
Имя | Краткое описание |
---|---|
Attribute | Перечисление атрибутов элемента. |
Body | Элемент, представляющий тело документа. |
Bookmark | Объект, представляющий закладку. |
ContainerElement | Общий элемент, который может содержать другие элементы. |
Date | Элемент, представляющий отформатированную дату |
Document | Документ, содержащий форматированный текст и такие элементы, как таблицы и списки. |
DocumentApp | Служба документов создает и открывает Documents , которые можно редактировать. |
Element | Общий элемент. |
ElementType | Перечисление всех типов элементов. |
Equation | Элемент, представляющий математическое выражение. |
EquationFunction | Элемент, представляющий функцию в математическом Equation . |
EquationFunctionArgumentSeparator | Элемент, представляющий разделитель функций в математическом Equation . |
EquationSymbol | Элемент, представляющий символ в математическом Equation . |
| Перечень поддерживаемых шрифтов. |
FooterSection | Элемент, представляющий раздел нижнего колонтитула. |
Footnote | Элемент, представляющий сноску. |
FootnoteSection | Элемент, представляющий раздел сноски. |
GlyphType | Перечисление поддерживаемых типов глифов. |
HeaderSection | Элемент, представляющий раздел заголовка. |
HorizontalAlignment | Перечень поддерживаемых типов горизонтального выравнивания. |
HorizontalRule | Элемент, представляющий горизонтальную линейку. |
InlineDrawing | Элемент, представляющий встроенный чертеж. |
InlineImage | Элемент, представляющий встроенное изображение. |
ListItem | Элемент, представляющий элемент списка. |
NamedRange | Range с именем и идентификатором для последующего извлечения. |
PageBreak | Элемент, представляющий разрыв страницы. |
Paragraph | Элемент, представляющий абзац. |
ParagraphHeading | Перечисление стандартных заголовков абзацев. |
Person | Элемент, представляющий ссылку на человека. |
Position | Ссылка на место в документе относительно определенного элемента. |
PositionedImage | Изображение с фиксированной позицией, привязанное к Paragraph . |
PositionedLayout | Перечисление, указывающее, как размещать PositionedImage по отношению к окружающему тексту. |
Range | Диапазон элементов в документе. |
RangeBuilder | Построитель, используемый для построения объектов Range из элементов документа. |
RangeElement | Обертка вокруг Element с возможным начальным и конечным смещением. |
RichLink | Элемент, представляющий ссылку на ресурс Google, например файл на Диске или видео на YouTube. |
Table | Элемент, представляющий таблицу. |
TableCell | Элемент, представляющий ячейку таблицы. |
TableOfContents | Элемент, содержащий оглавление. |
TableRow | Элемент, представляющий строку таблицы. |
Text | Элемент, представляющий область форматированного текста. |
TextAlignment | Перечисление типов выравнивания текста. |
UnsupportedElement | Элемент, представляющий область, которая неизвестна или не может быть затронута сценарием, например номер страницы. |
VerticalAlignment | Перечень поддерживаемых типов вертикального выравнивания. |
Attribute
Характеристики
Свойство | Тип | Описание |
---|---|---|
BACKGROUND_COLOR | Enum | Цвет фона элемента (абзаца, таблицы и т. д.) или документа. |
BOLD | Enum | Настройка веса шрифта для форматированного текста. |
BORDER_COLOR | Enum | Цвет границы для элементов таблицы. |
BORDER_WIDTH | Enum | Ширина границы в пунктах для элементов таблицы. |
CODE | Enum | Содержимое кода для элементов уравнения. |
FONT_FAMILY | Enum | Параметр семейства шрифтов для форматированного текста. |
FONT_SIZE | Enum | Настройка размера шрифта в пунктах для форматированного текста. |
FOREGROUND_COLOR | Enum | Настройка цвета переднего плана для форматированного текста. |
HEADING | Enum | Тип заголовка для элементов абзаца (например, DocumentApp.ParagraphHeading.HEADING1 ). |
HEIGHT | Enum | Настройка высоты для элементов изображения. |
HORIZONTAL_ALIGNMENT | Enum | Выравнивание по горизонтали для элементов абзаца (например, DocumentApp.HorizontalAlignment.CENTER ). |
INDENT_END | Enum | Параметр конечного отступа в пунктах для элементов абзаца. |
INDENT_FIRST_LINE | Enum | Настройка отступа первой строки в пунктах для элементов абзаца. |
INDENT_START | Enum | Настройка начального отступа в пунктах для элементов абзаца. |
ITALIC | Enum | Настройка стиля шрифта для форматированного текста. |
GLYPH_TYPE | Enum | Тип глифа для элементов элемента списка. |
LEFT_TO_RIGHT | Enum | Настройка направления текста для форматированного текста. |
LINE_SPACING | Enum | Межстрочный интервал как множитель для элементов абзаца. |
LINK_URL | Enum | URL-адрес ссылки для форматированного текста. |
LIST_ID | Enum | Идентификатор охватывающего списка для элементов элемента списка. |
MARGIN_BOTTOM | Enum | Настройка нижнего поля в пунктах для элементов абзаца. |
MARGIN_LEFT | Enum | Настройка левого поля в пунктах для элементов абзаца. |
MARGIN_RIGHT | Enum | Настройка правого поля в пунктах для элементов абзаца. |
MARGIN_TOP | Enum | Параметр верхнего поля в пунктах для элементов абзаца. |
NESTING_LEVEL | Enum | Уровень вложенности элементов для элементов списка. |
MINIMUM_HEIGHT | Enum | Установка минимальной высоты в пунктах для элементов строки таблицы. |
PADDING_BOTTOM | Enum | Настройка нижнего отступа в пунктах для элементов ячейки таблицы. |
PADDING_LEFT | Enum | Параметр отступа слева в пунктах для элементов ячейки таблицы. |
PADDING_RIGHT | Enum | Правильная настройка отступов в пунктах для элементов ячеек таблицы. |
PADDING_TOP | Enum | Параметр верхнего отступа в пунктах для элементов ячейки таблицы. |
PAGE_HEIGHT | Enum | Настройка высоты страницы в пунктах для документов. |
PAGE_WIDTH | Enum | Настройка ширины страницы в пунктах для документов. |
SPACING_AFTER | Enum | Настройка нижнего интервала в пунктах для элементов абзаца. |
SPACING_BEFORE | Enum | Верхний интервал в пунктах для элементов абзаца. |
STRIKETHROUGH | Enum | Настройка зачеркивания для форматированного текста. |
UNDERLINE | Enum | Параметр подчеркивания для форматированного текста. |
VERTICAL_ALIGNMENT | Enum | Параметр вертикального выравнивания для элементов ячейки таблицы. |
WIDTH | Enum | Настройка ширины для ячейки таблицы и элементов изображения. |
Body
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
appendHorizontalRule() | HorizontalRule | Создает и добавляет новое HorizontalRule . |
appendImage(image) | InlineImage | Создает и добавляет новый InlineImage из указанного большого двоичного объекта изображения. |
appendImage(image) | InlineImage | Добавляет заданный InlineImage . |
appendListItem(listItem) | ListItem | Добавляет заданный ListItem . |
appendListItem(text) | ListItem | Создает и добавляет новый ListItem , содержащий указанное текстовое содержимое. |
appendPageBreak() | PageBreak | Создает и добавляет новый PageBreak . |
appendPageBreak(pageBreak) | PageBreak | Добавляет заданный PageBreak . |
appendParagraph(paragraph) | Paragraph | Добавляет данный Paragraph . |
appendParagraph(text) | Paragraph | Создает и добавляет новый Paragraph , содержащий указанное текстовое содержимое. |
appendTable() | Table | Создает и добавляет новую Table . |
appendTable(cells) | Table | Добавляет новую Table , содержащую TableCell для каждого указанного строкового значения. |
appendTable(table) | Table | Добавляет данную Table . |
clear() | Body | Очищает содержимое элемента. |
copy() | Body | Возвращает отдельную, глубокую копию текущего элемента. |
editAsText() | Text | Получает Text версию текущего элемента для редактирования. |
findElement(elementType) | RangeElement | Ищет в содержимом элемента потомка указанного типа. |
findElement(elementType, from) | RangeElement | Ищет в содержимом элемента потомка указанного типа, начиная с указанного RangeElement . |
findText(searchPattern) | RangeElement | Ищет в содержимом элемента указанный текстовый шаблон, используя регулярные выражения. |
findText(searchPattern, from) | RangeElement | Выполняет поиск указанного текстового шаблона в содержимом элемента, начиная с заданного результата поиска. |
getAttributes() | Object | Извлекает атрибуты элемента. |
getChild(childIndex) | Element | Извлекает дочерний элемент по указанному дочернему индексу. |
getChildIndex(child) | Integer | Извлекает дочерний индекс для указанного дочернего элемента. |
getHeadingAttributes(paragraphHeading) | Object | Извлекает набор атрибутов для предоставленного ParagraphHeading . |
getImages() | InlineImage[] | Извлекает все InlineImages , содержащиеся в разделе. |
getListItems() | ListItem[] | Извлекает все ListItems , содержащиеся в разделе. |
getMarginBottom() | Number | Получает нижнее поле в пунктах. |
getMarginLeft() | Number | Получает левое поле в пунктах. |
getMarginRight() | Number | Получает правое поле. |
getMarginTop() | Number | Получает верхнее поле. |
getNumChildren() | Integer | Получает количество детей. |
getPageHeight() | Number | Получает высоту страницы в пунктах. |
getPageWidth() | Number | Получает ширину страницы в пунктах. |
getParagraphs() | Paragraph[] | Извлекает все Paragraphs , содержащиеся в разделе (включая ListItems ). |
getParent() | ContainerElement | Извлекает родительский элемент элемента. |
getTables() | Table[] | Извлекает все Tables , содержащиеся в разделе. |
getText() | String | Извлекает содержимое элемента в виде текстовой строки. |
getTextAlignment() | TextAlignment | Получает выравнивание текста. |
getType() | ElementType | Извлекает ElementType элемента. |
insertHorizontalRule(childIndex) | HorizontalRule | Создает и вставляет новое HorizontalRule по указанному индексу. |
insertImage(childIndex, image) | InlineImage | Создает и вставляет InlineImage из указанного большого двоичного объекта изображения по указанному индексу. |
insertImage(childIndex, image) | InlineImage | Вставляет заданный InlineImage по указанному индексу. |
insertListItem(childIndex, listItem) | ListItem | Вставляет данный ListItem по указанному индексу. |
insertListItem(childIndex, text) | ListItem | Создает и вставляет новый ListItem по указанному индексу, содержащий указанное текстовое содержимое. |
insertPageBreak(childIndex) | PageBreak | Создает и вставляет новый PageBreak по указанному индексу. |
insertPageBreak(childIndex, pageBreak) | PageBreak | Вставляет заданный PageBreak по указанному индексу. |
insertParagraph(childIndex, paragraph) | Paragraph | Вставляет данный Paragraph по указанному индексу. |
insertParagraph(childIndex, text) | Paragraph | Создает и вставляет новый Paragraph по указанному индексу, содержащий указанное текстовое содержимое. |
insertTable(childIndex) | Table | Создает и вставляет новую Table по указанному индексу. |
insertTable(childIndex, cells) | Table | Создает и вставляет новую Table , содержащую указанные ячейки, по указанному индексу. |
insertTable(childIndex, table) | Table | Вставляет данную Table по указанному индексу. |
removeChild(child) | Body | Удаляет указанный дочерний элемент. |
replaceText(searchPattern, replacement) | Element | Заменяет все вхождения заданного текстового шаблона заданной строкой замены, используя регулярные выражения. |
setAttributes(attributes) | Body | Задает атрибуты элемента. |
setHeadingAttributes(paragraphHeading, attributes) | Body | Задает атрибуты для предоставленного ParagraphHeading . |
setMarginBottom(marginBottom) | Body | Устанавливает нижнее поле в пунктах. |
setMarginLeft(marginLeft) | Body | Устанавливает левое поле в пунктах. |
setMarginRight(marginRight) | Body | Устанавливает правое поле в пунктах. |
setMarginTop(marginTop) | Body | Устанавливает верхнее поле. |
setPageHeight(pageHeight) | Body | Устанавливает высоту страницы в пунктах. |
setPageWidth(pageWidth) | Body | Устанавливает ширину страницы в пунктах. |
setText(text) | Body | Устанавливает содержимое как обычный текст. |
setTextAlignment(textAlignment) | Body | Устанавливает выравнивание текста. |
Bookmark
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
getId() | String | Получает идентификатор Bookmark . |
getPosition() | Position | Получает Position Bookmark в Document . |
remove() | void | Удаляет Bookmark . |
ContainerElement
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
asBody() | Body | Возвращает текущий элемент как Body . |
asEquation() | Equation | Возвращает текущий элемент в виде Equation . |
asFooterSection() | FooterSection | Возвращает текущий элемент в виде FooterSection . |
asFootnoteSection() | FootnoteSection | Возвращает текущий элемент в виде FootnoteSection . |
asHeaderSection() | HeaderSection | Возвращает текущий элемент в виде HeaderSection . |
asListItem() | ListItem | Возвращает текущий элемент как ListItem . |
asParagraph() | Paragraph | Возвращает текущий элемент как Paragraph . |
asTable() | Table | Возвращает текущий элемент в виде Table . |
asTableCell() | TableCell | Возвращает текущий элемент в виде TableCell . |
asTableOfContents() | TableOfContents | Возвращает текущий элемент как TableOfContents . |
asTableRow() | TableRow | Возвращает текущий элемент в виде TableRow . |
clear() | ContainerElement | Очищает содержимое элемента. |
copy() | ContainerElement | Возвращает отдельную, глубокую копию текущего элемента. |
editAsText() | Text | Получает Text версию текущего элемента для редактирования. |
findElement(elementType) | RangeElement | Ищет в содержимом элемента потомка указанного типа. |
findElement(elementType, from) | RangeElement | Ищет в содержимом элемента потомка указанного типа, начиная с указанного RangeElement . |
findText(searchPattern) | RangeElement | Ищет в содержимом элемента указанный текстовый шаблон, используя регулярные выражения. |
findText(searchPattern, from) | RangeElement | Выполняет поиск указанного текстового шаблона в содержимом элемента, начиная с заданного результата поиска. |
getAttributes() | Object | Извлекает атрибуты элемента. |
getChild(childIndex) | Element | Извлекает дочерний элемент по указанному дочернему индексу. |
getChildIndex(child) | Integer | Извлекает дочерний индекс для указанного дочернего элемента. |
getLinkUrl() | String | Получает URL-адрес ссылки. |
getNextSibling() | Element | Извлекает следующий одноуровневый элемент элемента. |
getNumChildren() | Integer | Получает количество детей. |
getParent() | ContainerElement | Извлекает родительский элемент элемента. |
getPreviousSibling() | Element | Извлекает предыдущий родственный элемент элемента. |
getText() | String | Извлекает содержимое элемента в виде текстовой строки. |
getTextAlignment() | TextAlignment | Получает выравнивание текста. |
getType() | ElementType | Извлекает ElementType элемента. |
isAtDocumentEnd() | Boolean | Определяет, находится ли элемент в конце Document . |
merge() | ContainerElement | Объединяет элемент с предыдущим элементом того же типа. |
removeFromParent() | ContainerElement | Удаляет элемент из его родителя. |
replaceText(searchPattern, replacement) | Element | Заменяет все вхождения заданного текстового шаблона заданной строкой замены, используя регулярные выражения. |
setAttributes(attributes) | ContainerElement | Задает атрибуты элемента. |
setLinkUrl(url) | ContainerElement | Устанавливает URL-адрес ссылки. |
setTextAlignment(textAlignment) | ContainerElement | Устанавливает выравнивание текста. |
Date
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
copy() | Date | Возвращает отдельную, глубокую копию текущего элемента. |
getAttributes() | Object | Извлекает атрибуты элемента. |
getDisplayText() | String | Возвращает отображаемое значение, отображаемое в документе. |
getLocale() | String | Возвращает языковой стандарт даты, используемый для отображаемого значения. |
getNextSibling() | Element | Извлекает следующий одноуровневый элемент элемента. |
getParent() | ContainerElement | Извлекает родительский элемент элемента. |
getPreviousSibling() | Element | Извлекает предыдущий родственный элемент элемента. |
getTimestamp() | Date | Возвращает отметку времени, связанную с датой. |
getType() | ElementType | Извлекает ElementType элемента. |
isAtDocumentEnd() | Boolean | Определяет, находится ли элемент в конце Document . |
merge() | Date | Объединяет элемент с предыдущим элементом того же типа. |
removeFromParent() | Date | Удаляет элемент из его родителя. |
setAttributes(attributes) | Date | Задает атрибуты элемента. |
Document
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
addBookmark(position) | Bookmark | Добавляет Bookmark в указанную Position . |
addEditor(emailAddress) | Document | Добавляет данного пользователя в список редакторов Document . |
addEditor(user) | Document | Добавляет данного пользователя в список редакторов Document . |
addEditors(emailAddresses) | Document | Добавляет указанный массив пользователей в список редакторов Document . |
addFooter() | FooterSection | Добавляет раздел нижнего колонтитула документа, если его нет. |
addHeader() | HeaderSection | Добавляет раздел заголовка документа, если он не существует. |
addNamedRange(name, range) | NamedRange | Добавляет NamedRange , который представляет собой Range с именем и идентификатором, которые можно использовать для последующего извлечения. |
addViewer(emailAddress) | Document | Добавляет данного пользователя в список зрителей Document . |
addViewer(user) | Document | Добавляет данного пользователя в список зрителей Document . |
addViewers(emailAddresses) | Document | Добавляет заданный массив пользователей в список зрителей для Document . |
getAs(contentType) | Blob | Извлекает текущее содержимое Document в виде большого двоичного объекта указанного типа. |
getBlob() | Blob | Извлекает текущее содержимое Document в виде большого двоичного объекта. |
getBody() | Body | Извлекает Body активного документа. |
getBookmark(id) | Bookmark | Получает Bookmark с заданным идентификатором. |
getBookmarks() | Bookmark[] | Получает все объекты Bookmark в документе. |
getCursor() | Position | Получает курсор пользователя в активном документе. |
getEditors() | User[] | Получает список редакторов этого Document . |
getFooter() | FooterSection | Извлекает раздел нижнего колонтитула документа, если он существует. |
getFootnotes() | Footnote[] | Извлекает все элементы Footnote в теле документа. |
getHeader() | HeaderSection | Извлекает раздел заголовка документа, если он существует. |
getId() | String | Получает уникальный идентификатор документа. |
getLanguage() | String | Получает код языка документа. |
getName() | String | Получает заголовок документа. |
getNamedRangeById(id) | NamedRange | Получает NamedRange с заданным идентификатором. |
getNamedRanges() | NamedRange[] | Получает все объекты NamedRange в документе. |
getNamedRanges(name) | NamedRange[] | Получает все объекты NamedRange в документе с заданным именем. |
getSelection() | Range | Получает выбор пользователя в активном документе. |
getSupportedLanguageCodes() | String[] | Получает коды всех языков, которые поддерживаются в файлах Документов Google. |
getUrl() | String | Извлекает URL-адрес для доступа к текущему документу. |
getViewers() | User[] | Получает список зрителей и комментаторов этого Document . |
newPosition(element, offset) | Position | Создает новую Position , которая является ссылкой на местоположение в документе относительно определенного элемента. |
newRange() | RangeBuilder | Создает построитель, используемый для построения объектов Range из элементов документа. |
removeEditor(emailAddress) | Document | Удаляет данного пользователя из списка редакторов Document . |
removeEditor(user) | Document | Удаляет данного пользователя из списка редакторов Document . |
removeViewer(emailAddress) | Document | Удаляет данного пользователя из списка просматривающих и комментирующих Document . |
removeViewer(user) | Document | Удаляет данного пользователя из списка просматривающих и комментирующих Document . |
saveAndClose() | void | Сохраняет текущий Document . |
setCursor(position) | Document | Устанавливает курсор пользователя в активном документе с учетом Position . |
setLanguage(languageCode) | Document | Устанавливает код языка документа. |
setName(name) | Document | Устанавливает заголовок документа. |
setSelection(range) | Document | Устанавливает выбор пользователя в активном документе с заданным Range . |
DocumentApp
Характеристики
Свойство | Тип | Описание |
---|---|---|
Attribute | Attribute | Перечисление Attribute . |
ElementType | ElementType | Перечисление ElementType . |
FontFamily |
| Перечисление . |
GlyphType | GlyphType | Перечисление GlyphType . |
HorizontalAlignment | HorizontalAlignment | Перечисление HorizontalAlignment . |
ParagraphHeading | ParagraphHeading | Перечисление ParagraphHeading . |
PositionedLayout | PositionedLayout | Перечисление PositionedLayout . |
TextAlignment | TextAlignment | Перечисление TextAlignment . |
VerticalAlignment | VerticalAlignment | Перечисление VerticalAlignment . |
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
create(name) | Document | Создает и возвращает новый документ. |
getActiveDocument() | Document | Возвращает документ, к которому скрипт привязывается к контейнеру . |
getUi() | Ui | Возвращает экземпляр среды пользовательского интерфейса документа, который позволяет сценарию добавлять такие функции, как меню, диалоговые окна и боковые панели. |
openById(id) | Document | Возвращает документ с указанным идентификатором. |
openByUrl(url) | Document | Открывает и возвращает документ с указанным URL. |
Element
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
asBody() | Body | Возвращает текущий элемент как Body . |
asDate() | Date | Возвращает текущий элемент как Date . |
asEquation() | Equation | Возвращает текущий элемент в виде Equation . |
asEquationFunction() | EquationFunction | Возвращает текущий элемент как EquationFunction . |
asEquationFunctionArgumentSeparator() | EquationFunctionArgumentSeparator | Возвращает текущий элемент в виде EquationFunctionArgumentSeparator . |
asEquationSymbol() | EquationSymbol | Возвращает текущий элемент в виде EquationSymbol . |
asFooterSection() | FooterSection | Возвращает текущий элемент в виде FooterSection . |
asFootnote() | Footnote | Возвращает текущий элемент в виде Footnote . |
asFootnoteSection() | FootnoteSection | Возвращает текущий элемент в виде FootnoteSection . |
asHeaderSection() | HeaderSection | Возвращает текущий элемент в виде HeaderSection . |
asHorizontalRule() | HorizontalRule | Возвращает текущий элемент как HorizontalRule . |
asInlineDrawing() | InlineDrawing | Возвращает текущий элемент как InlineDrawing . |
asInlineImage() | InlineImage | Возвращает текущий элемент как InlineImage . |
asListItem() | ListItem | Возвращает текущий элемент как ListItem . |
asPageBreak() | PageBreak | Возвращает текущий элемент как PageBreak . |
asParagraph() | Paragraph | Возвращает текущий элемент как Paragraph . |
asPerson() | Person | Возвращает текущий элемент как Person . |
asRichLink() | RichLink | Возвращает текущий элемент в виде RichLink , например, ссылку на файл Google Sheets. |
asTable() | Table | Возвращает текущий элемент в виде Table . |
asTableCell() | TableCell | Возвращает текущий элемент в виде TableCell . |
asTableOfContents() | TableOfContents | Возвращает текущий элемент как TableOfContents . |
asTableRow() | TableRow | Возвращает текущий элемент в виде TableRow . |
asText() | Text | Возвращает текущий элемент в виде Text . |
copy() | Element | Возвращает отдельную, глубокую копию текущего элемента. |
getAttributes() | Object | Извлекает атрибуты элемента. |
getNextSibling() | Element | Извлекает следующий одноуровневый элемент элемента. |
getParent() | ContainerElement | Извлекает родительский элемент элемента. |
getPreviousSibling() | Element | Извлекает предыдущий родственный элемент элемента. |
getType() | ElementType | Извлекает ElementType элемента. |
isAtDocumentEnd() | Boolean | Определяет, находится ли элемент в конце Document . |
merge() | Element | Объединяет элемент с предыдущим элементом того же типа. |
removeFromParent() | Element | Удаляет элемент из его родителя. |
setAttributes(attributes) | Element | Задает атрибуты элемента. |
ElementType
Характеристики
Свойство | Тип | Описание |
---|---|---|
BODY_SECTION | Enum | Тип, соответствующий элементу Body . |
COMMENT_SECTION | Enum | Тип, соответствующий элементу . |
DATE | Enum | Тип, соответствующий элементу Date . |
DOCUMENT | Enum | Тип, соответствующий корню документа. |
EQUATION | Enum | Тип, соответствующий элементу Equation . |
EQUATION_FUNCTION | Enum | Тип, соответствующий элементу EquationFunction . |
EQUATION_FUNCTION_ARGUMENT_SEPARATOR | Enum | Тип, соответствующий элементу EquationFunctionArgumentSeparator . |
EQUATION_SYMBOL | Enum | Тип, соответствующий элементу EquationSymbol . |
RICH_LINK | Enum | Тип, соответствующий элементу RichLink . |
FOOTER_SECTION | Enum | Тип, соответствующий элементу FooterSection . |
FOOTNOTE | Enum | Тип, соответствующий элементу Footnote . |
FOOTNOTE_SECTION | Enum | Тип, соответствующий элементу FootnoteSection . |
HEADER_SECTION | Enum | Тип, соответствующий элементу HeaderSection . |
HORIZONTAL_RULE | Enum | Тип, соответствующий элементу HorizontalRule . |
INLINE_DRAWING | Enum | Тип, соответствующий элементу InlineDrawing . |
INLINE_IMAGE | Enum | Тип, соответствующий элементу InlineImage . |
LIST_ITEM | Enum | Тип, соответствующий элементу ListItem . |
PAGE_BREAK | Enum | Тип, соответствующий элементу PageBreak . |
PARAGRAPH | Enum | Тип, соответствующий элементу Paragraph . |
PERSON | Enum | Тип, соответствующий элементу Person . |
TABLE | Enum | Тип, соответствующий элементу Table . |
TABLE_CELL | Enum | Тип, соответствующий элементу TableCell . |
TABLE_OF_CONTENTS | Enum | Тип, соответствующий элементу TableOfContents . |
TABLE_ROW | Enum | Тип, соответствующий элементу TableRow . |
TEXT | Enum | Тип, соответствующий элементу Text . |
UNSUPPORTED | Enum | Тип, соответствующий UnsupportedElement . |
Equation
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
clear() | Equation | Очищает содержимое элемента. |
copy() | Equation | Возвращает отдельную, глубокую копию текущего элемента. |
editAsText() | Text | Получает Text версию текущего элемента для редактирования. |
findElement(elementType) | RangeElement | Ищет в содержимом элемента потомка указанного типа. |
findElement(elementType, from) | RangeElement | Ищет в содержимом элемента потомка указанного типа, начиная с указанного RangeElement . |
findText(searchPattern) | RangeElement | Ищет в содержимом элемента указанный текстовый шаблон, используя регулярные выражения. |
findText(searchPattern, from) | RangeElement | Выполняет поиск указанного текстового шаблона в содержимом элемента, начиная с заданного результата поиска. |
getAttributes() | Object | Извлекает атрибуты элемента. |
getChild(childIndex) | Element | Извлекает дочерний элемент по указанному дочернему индексу. |
getChildIndex(child) | Integer | Извлекает дочерний индекс для указанного дочернего элемента. |
getLinkUrl() | String | Получает URL-адрес ссылки. |
getNextSibling() | Element | Извлекает следующий одноуровневый элемент элемента. |
getNumChildren() | Integer | Получает количество детей. |
getParent() | ContainerElement | Извлекает родительский элемент элемента. |
getPreviousSibling() | Element | Извлекает предыдущий родственный элемент элемента. |
getText() | String | Извлекает содержимое элемента в виде текстовой строки. |
getTextAlignment() | TextAlignment | Получает выравнивание текста. |
getType() | ElementType | Извлекает ElementType элемента. |
isAtDocumentEnd() | Boolean | Определяет, находится ли элемент в конце Document . |
merge() | Equation | Объединяет элемент с предыдущим элементом того же типа. |
removeFromParent() | Equation | Удаляет элемент из его родителя. |
replaceText(searchPattern, replacement) | Element | Заменяет все вхождения заданного текстового шаблона заданной строкой замены, используя регулярные выражения. |
setAttributes(attributes) | Equation | Задает атрибуты элемента. |
setLinkUrl(url) | Equation | Устанавливает URL-адрес ссылки. |
setTextAlignment(textAlignment) | Equation | Устанавливает выравнивание текста. |
EquationFunction
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
clear() | EquationFunction | Очищает содержимое элемента. |
copy() | EquationFunction | Возвращает отдельную, глубокую копию текущего элемента. |
editAsText() | Text | Получает Text версию текущего элемента для редактирования. |
findElement(elementType) | RangeElement | Ищет в содержимом элемента потомка указанного типа. |
findElement(elementType, from) | RangeElement | Ищет в содержимом элемента потомка указанного типа, начиная с указанного RangeElement . |
findText(searchPattern) | RangeElement | Ищет в содержимом элемента указанный текстовый шаблон, используя регулярные выражения. |
findText(searchPattern, from) | RangeElement | Выполняет поиск указанного текстового шаблона в содержимом элемента, начиная с заданного результата поиска. |
getAttributes() | Object | Извлекает атрибуты элемента. |
getChild(childIndex) | Element | Извлекает дочерний элемент по указанному дочернему индексу. |
getChildIndex(child) | Integer | Извлекает дочерний индекс для указанного дочернего элемента. |
getCode() | String | Извлекает код, соответствующий функции уравнения. |
getLinkUrl() | String | Получает URL-адрес ссылки. |
getNextSibling() | Element | Извлекает следующий одноуровневый элемент элемента. |
getNumChildren() | Integer | Получает количество детей. |
getParent() | ContainerElement | Извлекает родительский элемент элемента. |
getPreviousSibling() | Element | Извлекает предыдущий родственный элемент элемента. |
getText() | String | Извлекает содержимое элемента в виде текстовой строки. |
getTextAlignment() | TextAlignment | Получает выравнивание текста. |
getType() | ElementType | Извлекает ElementType элемента. |
isAtDocumentEnd() | Boolean | Определяет, находится ли элемент в конце Document . |
merge() | EquationFunction | Объединяет элемент с предыдущим элементом того же типа. |
removeFromParent() | EquationFunction | Удаляет элемент из его родителя. |
replaceText(searchPattern, replacement) | Element | Заменяет все вхождения заданного текстового шаблона заданной строкой замены, используя регулярные выражения. |
setAttributes(attributes) | EquationFunction | Задает атрибуты элемента. |
setLinkUrl(url) | EquationFunction | Устанавливает URL-адрес ссылки. |
setTextAlignment(textAlignment) | EquationFunction | Устанавливает выравнивание текста. |
EquationFunctionArgumentSeparator
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
copy() | EquationFunctionArgumentSeparator | Возвращает отдельную, глубокую копию текущего элемента. |
getAttributes() | Object | Извлекает атрибуты элемента. |
getNextSibling() | Element | Извлекает следующий одноуровневый элемент элемента. |
getParent() | ContainerElement | Извлекает родительский элемент элемента. |
getPreviousSibling() | Element | Извлекает предыдущий родственный элемент элемента. |
getType() | ElementType | Извлекает ElementType элемента. |
isAtDocumentEnd() | Boolean | Определяет, находится ли элемент в конце Document . |
merge() | EquationFunctionArgumentSeparator | Объединяет элемент с предыдущим элементом того же типа. |
removeFromParent() | EquationFunctionArgumentSeparator | Удаляет элемент из его родителя. |
setAttributes(attributes) | EquationFunctionArgumentSeparator | Задает атрибуты элемента. |
EquationSymbol
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
copy() | EquationSymbol | Возвращает отдельную, глубокую копию текущего элемента. |
getAttributes() | Object | Извлекает атрибуты элемента. |
getCode() | String | Извлекает код, соответствующий символу уравнения. |
getNextSibling() | Element | Извлекает следующий одноуровневый элемент элемента. |
getParent() | ContainerElement | Извлекает родительский элемент элемента. |
getPreviousSibling() | Element | Извлекает предыдущий родственный элемент элемента. |
getType() | ElementType | Извлекает ElementType элемента. |
isAtDocumentEnd() | Boolean | Определяет, находится ли элемент в конце Document . |
merge() | EquationSymbol | Объединяет элемент с предыдущим элементом того же типа. |
removeFromParent() | EquationSymbol | Удаляет элемент из его родителя. |
setAttributes(attributes) | EquationSymbol | Задает атрибуты элемента. |
FontFamily
FooterSection
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
appendHorizontalRule() | HorizontalRule | Создает и добавляет новое HorizontalRule . |
appendImage(image) | InlineImage | Создает и добавляет новый InlineImage из указанного большого двоичного объекта изображения. |
appendImage(image) | InlineImage | Добавляет заданный InlineImage . |
appendListItem(listItem) | ListItem | Добавляет заданный ListItem . |
appendListItem(text) | ListItem | Создает и добавляет новый ListItem , содержащий указанное текстовое содержимое. |
appendParagraph(paragraph) | Paragraph | Добавляет данный Paragraph . |
appendParagraph(text) | Paragraph | Создает и добавляет новый Paragraph , содержащий указанное текстовое содержимое. |
appendTable() | Table | Создает и добавляет новую Table . |
appendTable(cells) | Table | Добавляет новую Table , содержащую TableCell для каждого указанного строкового значения. |
appendTable(table) | Table | Добавляет данную Table . |
clear() | FooterSection | Очищает содержимое элемента. |
copy() | FooterSection | Возвращает отдельную, глубокую копию текущего элемента. |
editAsText() | Text | Получает Text версию текущего элемента для редактирования. |
findElement(elementType) | RangeElement | Ищет в содержимом элемента потомка указанного типа. |
findElement(elementType, from) | RangeElement | Ищет в содержимом элемента потомка указанного типа, начиная с указанного RangeElement . |
findText(searchPattern) | RangeElement | Ищет в содержимом элемента указанный текстовый шаблон, используя регулярные выражения. |
findText(searchPattern, from) | RangeElement | Выполняет поиск указанного текстового шаблона в содержимом элемента, начиная с заданного результата поиска. |
getAttributes() | Object | Извлекает атрибуты элемента. |
getChild(childIndex) | Element | Извлекает дочерний элемент по указанному дочернему индексу. |
getChildIndex(child) | Integer | Извлекает дочерний индекс для указанного дочернего элемента. |
getImages() | InlineImage[] | Извлекает все InlineImages , содержащиеся в разделе. |
getListItems() | ListItem[] | Извлекает все ListItems , содержащиеся в разделе. |
getNumChildren() | Integer | Получает количество детей. |
getParagraphs() | Paragraph[] | Извлекает все Paragraphs , содержащиеся в разделе (включая ListItems ). |
getParent() | ContainerElement | Извлекает родительский элемент элемента. |
getTables() | Table[] | Извлекает все Tables , содержащиеся в разделе. |
getText() | String | Извлекает содержимое элемента в виде текстовой строки. |
getTextAlignment() | TextAlignment | Получает выравнивание текста. |
getType() | ElementType | Извлекает ElementType элемента. |
insertHorizontalRule(childIndex) | HorizontalRule | Создает и вставляет новое HorizontalRule по указанному индексу. |
insertImage(childIndex, image) | InlineImage | Создает и вставляет InlineImage из указанного большого двоичного объекта изображения по указанному индексу. |
insertImage(childIndex, image) | InlineImage | Вставляет заданный InlineImage по указанному индексу. |
insertListItem(childIndex, listItem) | ListItem | Вставляет данный ListItem по указанному индексу. |
insertListItem(childIndex, text) | ListItem | Создает и вставляет новый ListItem по указанному индексу, содержащий указанное текстовое содержимое. |
insertParagraph(childIndex, paragraph) | Paragraph | Вставляет данный Paragraph по указанному индексу. |
insertParagraph(childIndex, text) | Paragraph | Создает и вставляет новый Paragraph по указанному индексу, содержащий указанное текстовое содержимое. |
insertTable(childIndex) | Table | Создает и вставляет новую Table по указанному индексу. |
insertTable(childIndex, cells) | Table | Создает и вставляет новую Table , содержащую указанные ячейки, по указанному индексу. |
insertTable(childIndex, table) | Table | Вставляет данную Table по указанному индексу. |
removeChild(child) | FooterSection | Удаляет указанный дочерний элемент. |
removeFromParent() | FooterSection | Удаляет элемент из его родителя. |
replaceText(searchPattern, replacement) | Element | Заменяет все вхождения заданного текстового шаблона заданной строкой замены, используя регулярные выражения. |
setAttributes(attributes) | FooterSection | Задает атрибуты элемента. |
setText(text) | FooterSection | Устанавливает содержимое как обычный текст. |
setTextAlignment(textAlignment) | FooterSection | Устанавливает выравнивание текста. |
Footnote
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
copy() | Footnote | Возвращает отдельную, глубокую копию текущего элемента. |
getAttributes() | Object | Извлекает атрибуты элемента. |
getFootnoteContents() | FootnoteSection | Извлекает содержимое элемента сноски. |
getNextSibling() | Element | Извлекает следующий одноуровневый элемент элемента. |
getParent() | ContainerElement | Извлекает родительский элемент элемента. |
getPreviousSibling() | Element | Извлекает предыдущий родственный элемент элемента. |
getType() | ElementType | Извлекает ElementType элемента. |
isAtDocumentEnd() | Boolean | Определяет, находится ли элемент в конце Document . |
removeFromParent() | Footnote | Удаляет элемент из его родителя. |
setAttributes(attributes) | Footnote | Задает атрибуты элемента. |
FootnoteSection
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
appendParagraph(paragraph) | Paragraph | Добавляет данный Paragraph . |
appendParagraph(text) | Paragraph | Создает и добавляет новый Paragraph , содержащий указанное текстовое содержимое. |
clear() | FootnoteSection | Очищает содержимое элемента. |
copy() | FootnoteSection | Возвращает отдельную, глубокую копию текущего элемента. |
editAsText() | Text | Получает Text версию текущего элемента для редактирования. |
findElement(elementType) | RangeElement | Ищет в содержимом элемента потомка указанного типа. |
findElement(elementType, from) | RangeElement | Ищет в содержимом элемента потомка указанного типа, начиная с указанного RangeElement . |
findText(searchPattern) | RangeElement | Ищет в содержимом элемента указанный текстовый шаблон, используя регулярные выражения. |
findText(searchPattern, from) | RangeElement | Выполняет поиск указанного текстового шаблона в содержимом элемента, начиная с заданного результата поиска. |
getAttributes() | Object | Извлекает атрибуты элемента. |
getChild(childIndex) | Element | Извлекает дочерний элемент по указанному дочернему индексу. |
getChildIndex(child) | Integer | Извлекает дочерний индекс для указанного дочернего элемента. |
getNextSibling() | Element | Извлекает следующий одноуровневый элемент элемента. |
getNumChildren() | Integer | Получает количество детей. |
getParagraphs() | Paragraph[] | Извлекает все Paragraphs , содержащиеся в разделе (включая ListItems ). |
getParent() | ContainerElement | Извлекает родительский элемент элемента. |
getPreviousSibling() | Element | Извлекает предыдущий родственный элемент элемента. |
getText() | String | Извлекает содержимое элемента в виде текстовой строки. |
getTextAlignment() | TextAlignment | Получает выравнивание текста. |
getType() | ElementType | Извлекает ElementType элемента. |
insertParagraph(childIndex, paragraph) | Paragraph | Вставляет данный Paragraph по указанному индексу. |
insertParagraph(childIndex, text) | Paragraph | Создает и вставляет новый Paragraph по указанному индексу, содержащий указанное текстовое содержимое. |
removeChild(child) | FootnoteSection | Удаляет указанный дочерний элемент. |
removeFromParent() | FootnoteSection | Удаляет элемент из его родителя. |
replaceText(searchPattern, replacement) | Element | Заменяет все вхождения заданного текстового шаблона заданной строкой замены, используя регулярные выражения. |
setAttributes(attributes) | FootnoteSection | Задает атрибуты элемента. |
setText(text) | FootnoteSection | Устанавливает содержимое как обычный текст. |
setTextAlignment(textAlignment) | FootnoteSection | Устанавливает выравнивание текста. |
GlyphType
Характеристики
Свойство | Тип | Описание |
---|---|---|
BULLET | Enum | Пуля по умолчанию, круглая и заполненная. |
HOLLOW_BULLET | Enum | Полая пуля. |
SQUARE_BULLET | Enum | Квадратная пуля. |
NUMBER | Enum | Пуля на основе числа. |
LATIN_UPPER | Enum | Латинская пуля в верхнем регистре. |
LATIN_LOWER | Enum | Латинская строчная пуля. |
ROMAN_UPPER | Enum | Римская цифра, прописная пуля. |
ROMAN_LOWER | Enum | Римская цифра, строчная пуля. |
HeaderSection
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
appendHorizontalRule() | HorizontalRule | Создает и добавляет новое HorizontalRule . |
appendImage(image) | InlineImage | Создает и добавляет новый InlineImage из указанного большого двоичного объекта изображения. |
appendImage(image) | InlineImage | Добавляет заданный InlineImage . |
appendListItem(listItem) | ListItem | Добавляет заданный ListItem . |
appendListItem(text) | ListItem | Создает и добавляет новый ListItem , содержащий указанное текстовое содержимое. |
appendParagraph(paragraph) | Paragraph | Добавляет данный Paragraph . |
appendParagraph(text) | Paragraph | Создает и добавляет новый Paragraph , содержащий указанное текстовое содержимое. |
appendTable() | Table | Создает и добавляет новую Table . |
appendTable(cells) | Table | Добавляет новую Table , содержащую TableCell для каждого указанного строкового значения. |
appendTable(table) | Table | Добавляет данную Table . |
clear() | HeaderSection | Очищает содержимое элемента. |
copy() | HeaderSection | Возвращает отдельную, глубокую копию текущего элемента. |
editAsText() | Text | Получает Text версию текущего элемента для редактирования. |
findElement(elementType) | RangeElement | Ищет в содержимом элемента потомка указанного типа. |
findElement(elementType, from) | RangeElement | Ищет в содержимом элемента потомка указанного типа, начиная с указанного RangeElement . |
findText(searchPattern) | RangeElement | Ищет в содержимом элемента указанный текстовый шаблон, используя регулярные выражения. |
findText(searchPattern, from) | RangeElement | Выполняет поиск указанного текстового шаблона в содержимом элемента, начиная с заданного результата поиска. |
getAttributes() | Object | Извлекает атрибуты элемента. |
getChild(childIndex) | Element | Извлекает дочерний элемент по указанному дочернему индексу. |
getChildIndex(child) | Integer | Извлекает дочерний индекс для указанного дочернего элемента. |
getImages() | InlineImage[] | Извлекает все InlineImages , содержащиеся в разделе. |
getListItems() | ListItem[] | Извлекает все ListItems , содержащиеся в разделе. |
getNumChildren() | Integer | Получает количество детей. |
getParagraphs() | Paragraph[] | Извлекает все Paragraphs , содержащиеся в разделе (включая ListItems ). |
getParent() | ContainerElement | Извлекает родительский элемент элемента. |
getTables() | Table[] | Извлекает все Tables , содержащиеся в разделе. |
getText() | String | Извлекает содержимое элемента в виде текстовой строки. |
getTextAlignment() | TextAlignment | Получает выравнивание текста. |
getType() | ElementType | Извлекает ElementType элемента. |
insertHorizontalRule(childIndex) | HorizontalRule | Создает и вставляет новое HorizontalRule по указанному индексу. |
insertImage(childIndex, image) | InlineImage | Создает и вставляет InlineImage из указанного большого двоичного объекта изображения по указанному индексу. |
insertImage(childIndex, image) | InlineImage | Вставляет заданный InlineImage по указанному индексу. |
insertListItem(childIndex, listItem) | ListItem | Вставляет данный ListItem по указанному индексу. |
insertListItem(childIndex, text) | ListItem | Создает и вставляет новый ListItem по указанному индексу, содержащий указанное текстовое содержимое. |
insertParagraph(childIndex, paragraph) | Paragraph | Вставляет данный Paragraph по указанному индексу. |
insertParagraph(childIndex, text) | Paragraph | Создает и вставляет новый Paragraph по указанному индексу, содержащий указанное текстовое содержимое. |
insertTable(childIndex) | Table | Создает и вставляет новую Table по указанному индексу. |
insertTable(childIndex, cells) | Table | Создает и вставляет новую Table , содержащую указанные ячейки, по указанному индексу. |
insertTable(childIndex, table) | Table | Вставляет данную Table по указанному индексу. |
removeChild(child) | HeaderSection | Удаляет указанный дочерний элемент. |
removeFromParent() | HeaderSection | Удаляет элемент из его родителя. |
replaceText(searchPattern, replacement) | Element | Заменяет все вхождения заданного текстового шаблона заданной строкой замены, используя регулярные выражения. |
setAttributes(attributes) | HeaderSection | Задает атрибуты элемента. |
setText(text) | HeaderSection | Устанавливает содержимое как обычный текст. |
setTextAlignment(textAlignment) | HeaderSection | Устанавливает выравнивание текста. |
HorizontalAlignment
Характеристики
Свойство | Тип | Описание |
---|---|---|
LEFT | Enum | Вариант выравнивания по левому краю. |
CENTER | Enum | Вариант выравнивания по центру. |
RIGHT | Enum | Вариант выравнивания по правому краю. |
JUSTIFY | Enum | Опция выравнивания по выравниванию. |
HorizontalRule
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
copy() | HorizontalRule | Возвращает отдельную, глубокую копию текущего элемента. |
getAttributes() | Object | Извлекает атрибуты элемента. |
getNextSibling() | Element | Извлекает следующий одноуровневый элемент элемента. |
getParent() | ContainerElement | Извлекает родительский элемент элемента. |
getPreviousSibling() | Element | Извлекает предыдущий родственный элемент элемента. |
getType() | ElementType | Извлекает ElementType элемента. |
isAtDocumentEnd() | Boolean | Определяет, находится ли элемент в конце Document . |
removeFromParent() | HorizontalRule | Удаляет элемент из его родителя. |
setAttributes(attributes) | HorizontalRule | Задает атрибуты элемента. |
InlineDrawing
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
copy() | InlineDrawing | Возвращает отдельную, глубокую копию текущего элемента. |
getAltDescription() | String | Возвращает альтернативное описание чертежа. |
getAltTitle() | String | Возвращает альтернативный заголовок чертежа. |
getAttributes() | Object | Извлекает атрибуты элемента. |
getNextSibling() | Element | Извлекает следующий одноуровневый элемент элемента. |
getParent() | ContainerElement | Извлекает родительский элемент элемента. |
getPreviousSibling() | Element | Извлекает предыдущий родственный элемент элемента. |
getType() | ElementType | Извлекает ElementType элемента. |
isAtDocumentEnd() | Boolean | Определяет, находится ли элемент в конце Document . |
merge() | InlineDrawing | Объединяет элемент с предыдущим элементом того же типа. |
removeFromParent() | InlineDrawing | Удаляет элемент из его родителя. |
setAltDescription(description) | InlineDrawing | Устанавливает альтернативное описание чертежа. |
setAltTitle(title) | InlineDrawing | Устанавливает альтернативный заголовок чертежа. |
setAttributes(attributes) | InlineDrawing | Задает атрибуты элемента. |
InlineImage
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
copy() | InlineImage | Возвращает отдельную, глубокую копию текущего элемента. |
getAltDescription() | String | Возвращает альтернативное описание изображения. |
getAltTitle() | String | Возвращает альтернативный заголовок изображения. |
getAs(contentType) | Blob | Верните данные внутри этого объекта в виде большого двоичного объекта, преобразованного в указанный тип контента. |
getAttributes() | Object | Извлекает атрибуты элемента. |
getBlob() | Blob | Верните данные внутри этого объекта в виде большого двоичного объекта. |
getHeight() | Integer | Получает высоту изображения в пикселях. |
getLinkUrl() | String | Получает URL-адрес ссылки. |
getNextSibling() | Element | Извлекает следующий одноуровневый элемент элемента. |
getParent() | ContainerElement | Извлекает родительский элемент элемента. |
getPreviousSibling() | Element | Извлекает предыдущий родственный элемент элемента. |
getType() | ElementType | Извлекает ElementType элемента. |
getWidth() | Integer | Получает ширину изображения в пикселях. |
isAtDocumentEnd() | Boolean | Определяет, находится ли элемент в конце Document . |
merge() | InlineImage | Объединяет элемент с предыдущим элементом того же типа. |
removeFromParent() | InlineImage | Удаляет элемент из его родителя. |
setAltDescription(description) | InlineImage | Устанавливает альтернативное описание изображения. |
setAltTitle(title) | InlineImage | Устанавливает альтернативный заголовок изображения. |
setAttributes(attributes) | InlineImage | Задает атрибуты элемента. |
setHeight(height) | InlineImage | Устанавливает высоту изображения в пикселях. |
setLinkUrl(url) | InlineImage | Устанавливает URL-адрес ссылки. |
setWidth(width) | InlineImage | Устанавливает ширину изображения в пикселях. |
ListItem
Методы
Метод | Тип возврата | Краткое описание |
---|---|---|
addPositionedImage(image) | PositionedImage | Создает и вставляет новый PositionedImage из указанного большого двоичного объекта изображения. |
appendHorizontalRule() | HorizontalRule | Создает и добавляет новое HorizontalRule . |
appendInlineImage(image) | InlineImage | Создает и добавляет новый InlineImage из указанного большого двоичного объекта изображения. |
appendInlineImage(image) | InlineImage | Добавляет заданный InlineImage . |
appendPageBreak() | PageBreak | Создает и добавляет новый PageBreak . |
appendPageBreak(pageBreak) | PageBreak | Добавляет заданный PageBreak . |
appendText(text) | Text | Создает и добавляет новый элемент Text с указанным содержимым. |
appendText(text) | Text | Добавляет заданный элемент Text . |
clear() | ListItem | Очищает содержимое элемента. |
copy() | ListItem | Возвращает отдельную, глубокую копию текущего элемента. |
editAsText() | Text | Получает Text версию текущего элемента для редактирования. |
findElement(elementType) | RangeElement | Ищет в содержимом элемента потомка указанного типа. |
findElement(elementType, from) | RangeElement | Ищет в содержимом элемента потомка указанного типа, начиная с указанного RangeElement . |
findText(searchPattern) | RangeElement | Ищет в содержимом элемента указанный текстовый шаблон, используя регулярные выражения. |
findText(searchPattern, from) | RangeElement | Выполняет поиск указанного текстового шаблона в содержимом элемента, начиная с заданного результата поиска. |
getAlignment() | HorizontalAlignment | Извлекает HorizontalAlignment . |
getAttributes() | Object | Извлекает атрибуты элемента. |
getChild(childIndex) | Element | Извлекает дочерний элемент по указанному дочернему индексу. |
getChildIndex(child) | Integer | Retrieves the child index for the specified child element. |
getGlyphType() | GlyphType | Retrieves the list item's GlyphType . |
getHeading() | ParagraphHeading | Retrieves the ParagraphHeading . |
getIndentEnd() | Number | Retrieves the end indentation, in points. |
getIndentFirstLine() | Number | Retrieves the first line indentation, in points. |
getIndentStart() | Number | Retrieves the start indentation. |
getLineSpacing() | Number | Retrieves the line spacing, in points. |
getLinkUrl() | String | Retrieves the link url. |
getListId() | String | Retrieves the list ID. |
getNestingLevel() | Integer | Retrieves the list item's nesting level. |
getNextSibling() | Element | Retrieves the element's next sibling element. |
getNumChildren() | Integer | Retrieves the number of children. |
getParent() | ContainerElement | Retrieves the element's parent element. |
getPositionedImage(id) | PositionedImage | Gets a PositionedImage by the image's ID. |
getPositionedImages() | PositionedImage[] | Gets all PositionedImage objects anchored to the paragraph. |
getPreviousSibling() | Element | Retrieves the element's previous sibling element. |
getSpacingAfter() | Number | Retrieves the spacing after the element, in points. |
getSpacingBefore() | Number | Retrieves the spacing before the element, in points. |
getText() | String | Retrieves the contents of the element as a text string. |
getTextAlignment() | TextAlignment | Gets the text alignment. |
getType() | ElementType | Retrieves the element's ElementType . |
insertHorizontalRule(childIndex) | HorizontalRule | Creates and inserts a HorizontalRule at the specified index. |
insertInlineImage(childIndex, image) | InlineImage | Creates and inserts a new InlineImage from the specified image blob, at the specified index. |
insertInlineImage(childIndex, image) | InlineImage | Inserts the given InlineImage at the specified index. |
insertPageBreak(childIndex) | PageBreak | Creates and inserts a new PageBreak at the specified index. |
insertPageBreak(childIndex, pageBreak) | PageBreak | Inserts the given PageBreak at the specified index. |
insertText(childIndex, text) | Text | Creates and inserts a new text element at the specified index. |
insertText(childIndex, text) | Text | Inserts the given Text element at the specified index, with the specified text contents. |
isAtDocumentEnd() | Boolean | Determines whether the element is at the end of the Document . |
isLeftToRight() | Boolean | Retrieves the left-to-right setting. |
merge() | ListItem | Merges the element with the preceding sibling of the same type. |
removeChild(child) | ListItem | Removes the specified child element. |
removeFromParent() | ListItem | Removes the element from its parent. |
removePositionedImage(id) | Boolean | Removes a PositionedImage by the image's ID. |
replaceText(searchPattern, replacement) | Element | Replaces all occurrences of a given text pattern with a given replacement string, using regular expressions. |
setAlignment(alignment) | ListItem | Sets the HorizontalAlignment . |
setAttributes(attributes) | ListItem | Sets the element's attributes. |
setGlyphType(glyphType) | ListItem | Sets the list item's GlyphType . |
setHeading(heading) | ListItem | Sets the ParagraphHeading . |
setIndentEnd(indentEnd) | ListItem | Sets the end indentation, in points. |
setIndentFirstLine(indentFirstLine) | ListItem | Sets the first line indentation, in points. |
setIndentStart(indentStart) | ListItem | Sets the start indentation, in points. |
setLeftToRight(leftToRight) | ListItem | Sets the left-to-right setting. |
setLineSpacing(multiplier) | ListItem | Sets the line spacing, as a quantity indicating the number of lines to use for spacing. |
setLinkUrl(url) | ListItem | Sets the link url. |
setListId(listItem) | ListItem | Sets the list ID. |
setNestingLevel(nestingLevel) | ListItem | Sets the list item's nesting level. |
setSpacingAfter(spacingAfter) | ListItem | Sets the spacing after the element, in points. |
setSpacingBefore(spacingBefore) | ListItem | Sets the spacing before the element, in points. |
setText(text) | void | Sets the contents of the list item as text. |
setTextAlignment(textAlignment) | ListItem | Sets the text alignment. |
NamedRange
Methods
Method | Return type | Brief description |
---|---|---|
getId() | String | Gets the ID of this NamedRange . |
getName() | String | Gets the name of this NamedRange . |
getRange() | Range | Gets the range of elements associated with this NamedRange . |
remove() | void | Removes this NamedRange from the document. |
PageBreak
Methods
Method | Return type | Brief description |
---|---|---|
copy() | PageBreak | Returns a detached, deep copy of the current element. |
getAttributes() | Object | Retrieves the element's attributes. |
getNextSibling() | Element | Retrieves the element's next sibling element. |
getParent() | ContainerElement | Retrieves the element's parent element. |
getPreviousSibling() | Element | Retrieves the element's previous sibling element. |
getType() | ElementType | Retrieves the element's ElementType . |
isAtDocumentEnd() | Boolean | Determines whether the element is at the end of the Document . |
removeFromParent() | PageBreak | Removes the element from its parent. |
setAttributes(attributes) | PageBreak | Sets the element's attributes. |
Paragraph
Methods
Method | Return type | Brief description |
---|---|---|
addPositionedImage(image) | PositionedImage | Creates and inserts a new PositionedImage from the specified image blob. |
appendHorizontalRule() | HorizontalRule | Creates and appends a new HorizontalRule . |
appendInlineImage(image) | InlineImage | Creates and appends a new InlineImage from the specified image blob. |
appendInlineImage(image) | InlineImage | Appends the given InlineImage . |
appendPageBreak() | PageBreak | Creates and appends a new PageBreak . |
appendPageBreak(pageBreak) | PageBreak | Appends the given PageBreak . |
appendText(text) | Text | Creates and appends a new Text element with the specified contents. |
appendText(text) | Text | Appends the given Text element. |
clear() | Paragraph | Clears the contents of the element. |
copy() | Paragraph | Returns a detached, deep copy of the current element. |
editAsText() | Text | Obtains a Text version of the current element, for editing. |
findElement(elementType) | RangeElement | Searches the contents of the element for a descendant of the specified type. |
findElement(elementType, from) | RangeElement | Searches the contents of the element for a descendant of the specified type, starting from the specified RangeElement . |
findText(searchPattern) | RangeElement | Searches the contents of the element for the specified text pattern using regular expressions. |
findText(searchPattern, from) | RangeElement | Searches the contents of the element for the specified text pattern, starting from a given search result. |
getAlignment() | HorizontalAlignment | Retrieves the HorizontalAlignment . |
getAttributes() | Object | Retrieves the element's attributes. |
getChild(childIndex) | Element | Retrieves the child element at the specified child index. |
getChildIndex(child) | Integer | Retrieves the child index for the specified child element. |
getHeading() | ParagraphHeading | Retrieves the ParagraphHeading . |
getIndentEnd() | Number | Retrieves the end indentation, in points. |
getIndentFirstLine() | Number | Retrieves the first line indentation, in points. |
getIndentStart() | Number | Retrieves the start indentation. |
getLineSpacing() | Number | Retrieves the line spacing, in points. |
getLinkUrl() | String | Retrieves the link url. |
getNextSibling() | Element | Retrieves the element's next sibling element. |
getNumChildren() | Integer | Retrieves the number of children. |
getParent() | ContainerElement | Retrieves the element's parent element. |
getPositionedImage(id) | PositionedImage | Gets a PositionedImage by the image's ID. |
getPositionedImages() | PositionedImage[] | Gets all PositionedImage objects anchored to the paragraph. |
getPreviousSibling() | Element | Retrieves the element's previous sibling element. |
getSpacingAfter() | Number | Retrieves the spacing after the element, in points. |
getSpacingBefore() | Number | Retrieves the spacing before the element, in points. |
getText() | String | Retrieves the contents of the element as a text string. |
getTextAlignment() | TextAlignment | Gets the text alignment. |
getType() | ElementType | Retrieves the element's ElementType . |
insertHorizontalRule(childIndex) | HorizontalRule | Creates and inserts a HorizontalRule at the specified index. |
insertInlineImage(childIndex, image) | InlineImage | Creates and inserts a new InlineImage from the specified image blob, at the specified index. |
insertInlineImage(childIndex, image) | InlineImage | Inserts the given InlineImage at the specified index. |
insertPageBreak(childIndex) | PageBreak | Creates and inserts a new PageBreak at the specified index. |
insertPageBreak(childIndex, pageBreak) | PageBreak | Inserts the given PageBreak at the specified index. |
insertText(childIndex, text) | Text | Creates and inserts a new text element at the specified index. |
insertText(childIndex, text) | Text | Inserts the given Text element at the specified index, with the specified text contents. |
isAtDocumentEnd() | Boolean | Determines whether the element is at the end of the Document . |
isLeftToRight() | Boolean | Retrieves the left-to-right setting. |
merge() | Paragraph | Merges the element with the preceding sibling of the same type. |
removeChild(child) | Paragraph | Removes the specified child element. |
removeFromParent() | Paragraph | Removes the element from its parent. |
removePositionedImage(id) | Boolean | Removes a PositionedImage by the image's ID. |
replaceText(searchPattern, replacement) | Element | Replaces all occurrences of a given text pattern with a given replacement string, using regular expressions. |
setAlignment(alignment) | Paragraph | Sets the HorizontalAlignment . |
setAttributes(attributes) | Paragraph | Sets the element's attributes. |
setHeading(heading) | Paragraph | Sets the ParagraphHeading . |
setIndentEnd(indentEnd) | Paragraph | Sets the end indentation, in points. |
setIndentFirstLine(indentFirstLine) | Paragraph | Sets the first line indentation, in points. |
setIndentStart(indentStart) | Paragraph | Sets the start indentation, in points. |
setLeftToRight(leftToRight) | Paragraph | Sets the left-to-right setting. |
setLineSpacing(multiplier) | Paragraph | Sets the line spacing, as a quantity indicating the number of lines to use for spacing. |
setLinkUrl(url) | Paragraph | Sets the link url. |
setSpacingAfter(spacingAfter) | Paragraph | Sets the spacing after the element, in points. |
setSpacingBefore(spacingBefore) | Paragraph | Sets the spacing before the element, in points. |
setText(text) | void | Sets the contents of the paragraph as text. |
setTextAlignment(textAlignment) | Paragraph | Sets the text alignment. |
ParagraphHeading
Характеристики
Свойство | Тип | Описание |
---|---|---|
NORMAL | Enum | The heading option for normal text. |
HEADING1 | Enum | The highest heading option. |
HEADING2 | Enum | The second heading option. |
HEADING3 | Enum | The third heading option |
HEADING4 | Enum | The fourth heading option. |
HEADING5 | Enum | The fifth heading option. |
HEADING6 | Enum | The lowest heading option. |
TITLE | Enum | The title heading option. |
SUBTITLE | Enum | The subtitle heading option. |
Person
Methods
Method | Return type | Brief description |
---|---|---|
copy() | Person | Returns a detached, deep copy of the current element. |
getAttributes() | Object | Retrieves the element's attributes. |
getEmail() | String | Returns the person's email address. |
getName() | String | Returns the person's display name, if set. |
getNextSibling() | Element | Retrieves the element's next sibling element. |
getParent() | ContainerElement | Retrieves the element's parent element. |
getPreviousSibling() | Element | Retrieves the element's previous sibling element. |
getType() | ElementType | Retrieves the element's ElementType . |
isAtDocumentEnd() | Boolean | Determines whether the element is at the end of the Document . |
merge() | Person | Merges the element with the preceding sibling of the same type. |
removeFromParent() | Person | Removes the element from its parent. |
setAttributes(attributes) | Person | Sets the element's attributes. |
Position
Methods
Method | Return type | Brief description |
---|---|---|
getElement() | Element | Gets the element that contains this Position . |
getOffset() | Integer | Gets this Position 's relative location within the element that contains it. |
getSurroundingText() | Text | Creates an artificial Text element that represents the text and formatting of the Paragraph or ListItem that contains the Position , either directly or through a chain of child elements. |
getSurroundingTextOffset() | Integer | Gets the offset of this Position within the Text element returned by getSurroundingText() . |
insertBookmark() | Bookmark | Creates and inserts a new Bookmark at this Position . |
insertInlineImage(image) | InlineImage | Creates and inserts a new InlineImage at this Position from the specified image blob. |
insertText(text) | Text | Inserts the specified text at this Position . |
PositionedImage
Methods
Method | Return type | Brief description |
---|---|---|
getAs(contentType) | Blob | Return the data inside this object as a blob converted to the specified content type. |
getBlob() | Blob | Return the data inside this object as a blob. |
getHeight() | Integer | Retrieves the image's height, in pixels. |
getId() | String | Gets the image's ID. |
getLayout() | PositionedLayout | Gets an enum value that represents how the image is laid out. |
getLeftOffset() | Number | Gets the image's offset, in points, from the paragraph's left. |
getParagraph() | Paragraph | Gets the Paragraph the image is anchored to. |
getTopOffset() | Number | Gets the image's offset, in points, from the paragraph's top. |
getWidth() | Integer | Retrieves the image's width, in pixels. |
setHeight(height) | PositionedImage | Sets the image's height, in pixels. |
setLayout(layout) | PositionedImage | Sets the definition of how the image is laid out. |
setLeftOffset(offset) | PositionedImage | Sets the image's offset, in points, from the paragraph's left. |
setTopOffset(offset) | PositionedImage | Sets the image's offset, in points, from the paragraph's top. |
setWidth(width) | PositionedImage | Sets the image's width, in pixels. |
PositionedLayout
Характеристики
Свойство | Тип | Описание |
---|---|---|
ABOVE_TEXT | Enum | The image is positioned above the text. |
BREAK_BOTH | Enum | The image breaks the text on the left and right. |
BREAK_LEFT | Enum | The image breaks the text on the left. |
BREAK_RIGHT | Enum | The image breaks the text on the right. |
WRAP_TEXT | Enum | The image is wrapped by text. |
Range
Methods
Method | Return type | Brief description |
---|---|---|
getRangeElements() | RangeElement[] | Gets all elements in this Range , including any partial Text elements (for example, in the case of a selection that includes only part of a Text element). |
RangeBuilder
Methods
Method | Return type | Brief description |
---|---|---|
addElement(element) | RangeBuilder | Adds an entire Element to this RangeBuilder . |
addElement(textElement, startOffset, endOffsetInclusive) | RangeBuilder | Adds a partial Text element to this RangeBuilder . |
addElementsBetween(startElement, endElementInclusive) | RangeBuilder | Adds two entire elements, and all elements between them, to this RangeBuilder . |
addElementsBetween(startTextElement, startOffset, endTextElementInclusive, endOffsetInclusive) | RangeBuilder | Adds two partial Text elements, and all elements between them, to the RangeBuilder . |
addRange(range) | RangeBuilder | Adds the contents of another Range to this RangeBuilder . |
build() | Range | Constructs a Range from the settings applied to the builder. |
getRangeElements() | RangeElement[] | Gets all elements in this Range , including any partial Text elements (for example, in the case of a selection that includes only part of a Text element). |
RangeElement
Methods
Method | Return type | Brief description |
---|---|---|
getElement() | Element | Gets the Element that corresponds to this RangeElement . |
getEndOffsetInclusive() | Integer | Gets the position of the end of a partial range within the range element. |
getStartOffset() | Integer | Gets the position of the start of a partial range within the range element. |
isPartial() | Boolean | Determines whether this range element covers the entire element or a partial selection of the element's characters. |
RichLink
Methods
Method | Return type | Brief description |
---|---|---|
copy() | RichLink | Returns a detached, deep copy of the current element. |
getAttributes() | Object | Retrieves the element's attributes. |
getMimeType() | String | Returns the MIME type of the link, which is available when the item is a link to a Drive file and null otherwise. |
getNextSibling() | Element | Retrieves the element's next sibling element. |
getParent() | ContainerElement | Retrieves the element's parent element. |
getPreviousSibling() | Element | Retrieves the element's previous sibling element. |
getTitle() | String | Returns the link's displayed title. |
getType() | ElementType | Retrieves the element's ElementType . |
getUrl() | String | Returns the URL of the resource. |
isAtDocumentEnd() | Boolean | Determines whether the element is at the end of the Document . |
merge() | RichLink | Merges the element with the preceding sibling of the same type. |
removeFromParent() | RichLink | Removes the element from its parent. |
setAttributes(attributes) | RichLink | Sets the element's attributes. |
Table
Methods
Method | Return type | Brief description |
---|---|---|
appendTableRow() | TableRow | Creates and appends a new TableRow . |
appendTableRow(tableRow) | TableRow | Appends the given TableRow . |
clear() | Table | Clears the contents of the element. |
copy() | Table | Returns a detached, deep copy of the current element. |
editAsText() | Text | Obtains a Text version of the current element, for editing. |
findElement(elementType) | RangeElement | Searches the contents of the element for a descendant of the specified type. |
findElement(elementType, from) | RangeElement | Searches the contents of the element for a descendant of the specified type, starting from the specified RangeElement . |
findText(searchPattern) | RangeElement | Searches the contents of the element for the specified text pattern using regular expressions. |
findText(searchPattern, from) | RangeElement | Searches the contents of the element for the specified text pattern, starting from a given search result. |
getAttributes() | Object | Retrieves the element's attributes. |
getBorderColor() | String | Retrieves the border color. |
getBorderWidth() | Number | Retrieves the border width, in points. |
getCell(rowIndex, cellIndex) | TableCell | Retrieves the TableCell at the specified row and cell indices. |
getChild(childIndex) | Element | Retrieves the child element at the specified child index. |
getChildIndex(child) | Integer | Retrieves the child index for the specified child element. |
getColumnWidth(columnIndex) | Number | Retrieves the width of the specified table column, in points. |
getLinkUrl() | String | Retrieves the link url. |
getNextSibling() | Element | Retrieves the element's next sibling element. |
getNumChildren() | Integer | Retrieves the number of children. |
getNumRows() | Integer | Retrieves the number of TableRows . |
getParent() | ContainerElement | Retrieves the element's parent element. |
getPreviousSibling() | Element | Retrieves the element's previous sibling element. |
getRow(rowIndex) | TableRow | Retrieves the TableRow at the specified row index. |
getText() | String | Retrieves the contents of the element as a text string. |
getTextAlignment() | TextAlignment | Gets the text alignment. |
getType() | ElementType | Retrieves the element's ElementType . |
insertTableRow(childIndex) | TableRow | Creates and inserts a new TableRow at the specified index. |
insertTableRow(childIndex, tableRow) | TableRow | Inserts the given TableRow at the specified index. |
isAtDocumentEnd() | Boolean | Determines whether the element is at the end of the Document . |
removeChild(child) | Table | Removes the specified child element. |
removeFromParent() | Table | Removes the element from its parent. |
removeRow(rowIndex) | TableRow | Removes the TableRow at the specified row index. |
replaceText(searchPattern, replacement) | Element | Replaces all occurrences of a given text pattern with a given replacement string, using regular expressions. |
setAttributes(attributes) | Table | Sets the element's attributes. |
setBorderColor(color) | Table | Sets the border color. |
setBorderWidth(width) | Table | Sets the border width, in points. |
setColumnWidth(columnIndex, width) | Table | Sets the width of the specified column, in points. |
setLinkUrl(url) | Table | Sets the link url. |
setTextAlignment(textAlignment) | Table | Sets the text alignment. |
TableCell
Methods
Method | Return type | Brief description |
---|---|---|
appendHorizontalRule() | HorizontalRule | Creates and appends a new HorizontalRule . |
appendImage(image) | InlineImage | Creates and appends a new InlineImage from the specified image blob. |
appendImage(image) | InlineImage | Appends the given InlineImage . |
appendListItem(listItem) | ListItem | Appends the given ListItem . |
appendListItem(text) | ListItem | Creates and appends a new ListItem . |
appendParagraph(paragraph) | Paragraph | Appends the given Paragraph . |
appendParagraph(text) | Paragraph | Creates and appends a new Paragraph . |
appendTable() | Table | Creates and appends a new Table . |
appendTable(cells) | Table | Appends a new Table containing the specified cells. |
appendTable(table) | Table | Appends the given Table . |
clear() | TableCell | Clears the contents of the element. |
copy() | TableCell | Returns a detached, deep copy of the current element. |
editAsText() | Text | Obtains a Text version of the current element, for editing. |
findElement(elementType) | RangeElement | Searches the contents of the element for a descendant of the specified type. |
findElement(elementType, from) | RangeElement | Searches the contents of the element for a descendant of the specified type, starting from the specified RangeElement . |
findText(searchPattern) | RangeElement | Searches the contents of the element for the specified text pattern using regular expressions. |
findText(searchPattern, from) | RangeElement | Searches the contents of the element for the specified text pattern, starting from a given search result. |
getAttributes() | Object | Retrieves the element's attributes. |
getBackgroundColor() | String | Retrieves the background color. |
getChild(childIndex) | Element | Retrieves the child element at the specified child index. |
getChildIndex(child) | Integer | Retrieves the child index for the specified child element. |
getColSpan() | Integer | Retrieves the column span, which is the number of columns of table cells this cell spans. |
getLinkUrl() | String | Retrieves the link url. |
getNextSibling() | Element | Retrieves the element's next sibling element. |
getNumChildren() | Integer | Retrieves the number of children. |
getPaddingBottom() | Number | Retrieves the bottom padding, in points. |
getPaddingLeft() | Number | Retrieves the left padding, in points. |
getPaddingRight() | Number | Retrieves the right padding, in points. |
getPaddingTop() | Number | Retrieves the top padding, in points. |
getParent() | ContainerElement | Retrieves the element's parent element. |
getParentRow() | TableRow | Retrieves the TableRow containing the current TableCell . |
getParentTable() | Table | Retrieves the Table containing the current TableCell . |
getPreviousSibling() | Element | Retrieves the element's previous sibling element. |
getRowSpan() | Integer | Retrieves the row span, which is the number of rows of table cells this cell spans. |
getText() | String | Retrieves the contents of the element as a text string. |
getTextAlignment() | TextAlignment | Gets the text alignment. |
getType() | ElementType | Retrieves the element's ElementType . |
getVerticalAlignment() | VerticalAlignment | Retrieves the VerticalAlignment . |
getWidth() | Number | Retrieves the width of the column containing the cell, in points. |
insertHorizontalRule(childIndex) | HorizontalRule | Creates and inserts a new HorizontalRule at the specified index. |
insertImage(childIndex, image) | InlineImage | Creates and inserts an InlineImage from the specified image blob, at the specified index. |
insertImage(childIndex, image) | InlineImage | Inserts the given InlineImage at the specified index. |
insertListItem(childIndex, listItem) | ListItem | Inserts the given ListItem at the specified index. |
insertListItem(childIndex, text) | ListItem | Creates and inserts a new ListItem at the specified index. |
insertParagraph(childIndex, paragraph) | Paragraph | Inserts the given Paragraph at the specified index. |
insertParagraph(childIndex, text) | Paragraph | Creates and inserts a new Paragraph at the specified index. |
insertTable(childIndex) | Table | Creates and inserts a new Table at the specified index. |
insertTable(childIndex, cells) | Table | Creates and inserts a new Table containing the specified cells, at the specified index. |
insertTable(childIndex, table) | Table | Inserts the given Table at the specified index. |
isAtDocumentEnd() | Boolean | Determines whether the element is at the end of the Document . |
merge() | TableCell | Merges the element with the preceding sibling of the same type. |
removeChild(child) | TableCell | Removes the specified child element. |
removeFromParent() | TableCell | Removes the element from its parent. |
replaceText(searchPattern, replacement) | Element | Replaces all occurrences of a given text pattern with a given replacement string, using regular expressions. |
setAttributes(attributes) | TableCell | Sets the element's attributes. |
setBackgroundColor(color) | TableCell | Sets the background color. |
setLinkUrl(url) | TableCell | Sets the link url. |
setPaddingBottom(paddingBottom) | TableCell | Sets the bottom padding, in points. |
setPaddingLeft(paddingLeft) | TableCell | Sets the left padding, in points. |
setPaddingRight(paddingTop) | TableCell | Sets the right padding, in points. |
setPaddingTop(paddingTop) | TableCell | Sets the top padding, in points. |
setText(text) | TableCell | Sets the contents as plain text. |
setTextAlignment(textAlignment) | TableCell | Sets the text alignment. |
setVerticalAlignment(alignment) | TableCell | Sets the vertical alignment. |
setWidth(width) | TableCell | Sets the width of the column containing the current cell, in points. |
TableOfContents
Methods
Method | Return type | Brief description |
---|---|---|
clear() | TableOfContents | Clears the contents of the element. |
copy() | TableOfContents | Returns a detached, deep copy of the current element. |
editAsText() | Text | Obtains a Text version of the current element, for editing. |
findElement(elementType) | RangeElement | Searches the contents of the element for a descendant of the specified type. |
findElement(elementType, from) | RangeElement | Searches the contents of the element for a descendant of the specified type, starting from the specified RangeElement . |
findText(searchPattern) | RangeElement | Searches the contents of the element for the specified text pattern using regular expressions. |
findText(searchPattern, from) | RangeElement | Searches the contents of the element for the specified text pattern, starting from a given search result. |
getAttributes() | Object | Retrieves the element's attributes. |
getChild(childIndex) | Element | Retrieves the child element at the specified child index. |
getChildIndex(child) | Integer | Retrieves the child index for the specified child element. |
getLinkUrl() | String | Retrieves the link url. |
getNextSibling() | Element | Retrieves the element's next sibling element. |
getNumChildren() | Integer | Retrieves the number of children. |
getParent() | ContainerElement | Retrieves the element's parent element. |
getPreviousSibling() | Element | Retrieves the element's previous sibling element. |
getText() | String | Retrieves the contents of the element as a text string. |
getTextAlignment() | TextAlignment | Gets the text alignment. |
getType() | ElementType | Retrieves the element's ElementType . |
isAtDocumentEnd() | Boolean | Determines whether the element is at the end of the Document . |
removeFromParent() | TableOfContents | Removes the element from its parent. |
replaceText(searchPattern, replacement) | Element | Replaces all occurrences of a given text pattern with a given replacement string, using regular expressions. |
setAttributes(attributes) | TableOfContents | Sets the element's attributes. |
setLinkUrl(url) | TableOfContents | Sets the link url. |
setTextAlignment(textAlignment) | TableOfContents | Sets the text alignment. |
TableRow
Methods
Method | Return type | Brief description |
---|---|---|
appendTableCell() | TableCell | Creates and appends a new TableCell . |
appendTableCell(textContents) | TableCell | Appends the given TableCell containing the specified text. |
appendTableCell(tableCell) | TableCell | Appends the given TableCell . |
clear() | TableRow | Clears the contents of the element. |
copy() | TableRow | Returns a detached, deep copy of the current element. |
editAsText() | Text | Obtains a Text version of the current element, for editing. |
findElement(elementType) | RangeElement | Searches the contents of the element for a descendant of the specified type. |
findElement(elementType, from) | RangeElement | Searches the contents of the element for a descendant of the specified type, starting from the specified RangeElement . |
findText(searchPattern) | RangeElement | Searches the contents of the element for the specified text pattern using regular expressions. |
findText(searchPattern, from) | RangeElement | Searches the contents of the element for the specified text pattern, starting from a given search result. |
getAttributes() | Object | Retrieves the element's attributes. |
getCell(cellIndex) | TableCell | Retrieves the TableCell at the specified cell index. |
getChild(childIndex) | Element | Retrieves the child element at the specified child index. |
getChildIndex(child) | Integer | Retrieves the child index for the specified child element. |
getLinkUrl() | String | Retrieves the link url. |
getMinimumHeight() | Number | Retrieves the minimum height, in points. |
getNextSibling() | Element | Retrieves the element's next sibling element. |
getNumCells() | Integer | Retrieves the number of cells in the row. |
getNumChildren() | Integer | Retrieves the number of children. |
getParent() | ContainerElement | Retrieves the element's parent element. |
getParentTable() | Table | Retrieves the Table containing the current row. |
getPreviousSibling() | Element | Retrieves the element's previous sibling element. |
getText() | String | Retrieves the contents of the element as a text string. |
getTextAlignment() | TextAlignment | Gets the text alignment. |
getType() | ElementType | Retrieves the element's ElementType . |
insertTableCell(childIndex) | TableCell | Creates and inserts a new TableCell at the specified index. |
insertTableCell(childIndex, textContents) | TableCell | Inserts the given TableCell at the specified index, containing the given text. |
insertTableCell(childIndex, tableCell) | TableCell | Inserts the given TableCell at the specified index. |
isAtDocumentEnd() | Boolean | Determines whether the element is at the end of the Document . |
merge() | TableRow | Merges the element with the preceding sibling of the same type. |
removeCell(cellIndex) | TableCell | Removes the TableCell at the specified cell index. |
removeChild(child) | TableRow | Removes the specified child element. |
removeFromParent() | TableRow | Removes the element from its parent. |
replaceText(searchPattern, replacement) | Element | Replaces all occurrences of a given text pattern with a given replacement string, using regular expressions. |
setAttributes(attributes) | TableRow | Sets the element's attributes. |
setLinkUrl(url) | TableRow | Sets the link url. |
setMinimumHeight(minHeight) | TableRow | Sets the minimum height, in points. |
setTextAlignment(textAlignment) | TableRow | Sets the text alignment. |
Text
Methods
Method | Return type | Brief description |
---|---|---|
appendText(text) | Text | Adds the specified text to the end of this text region. |
copy() | Text | Returns a detached, deep copy of the current element. |
deleteText(startOffset, endOffsetInclusive) | Text | Deletes a range of text. |
editAsText() | Text | Obtains a Text version of the current element, for editing. |
findText(searchPattern) | RangeElement | Searches the contents of the element for the specified text pattern using regular expressions. |
findText(searchPattern, from) | RangeElement | Searches the contents of the element for the specified text pattern, starting from a given search result. |
getAttributes() | Object | Retrieves the element's attributes. |
getAttributes(offset) | Object | Retrieves the attributes at the specified character offset. |
getBackgroundColor() | String | Retrieves the background color setting. |
getBackgroundColor(offset) | String | Retrieves the background color at the specified character offset. |
getFontFamily() | String | Retrieves the font family setting. |
getFontFamily(offset) | String | Retrieves the font family at the specified character offset. |
getFontSize() | Number | Retrieves the font size setting. |
getFontSize(offset) | Number | Retrieves the font size at the specified character offset. |
getForegroundColor() | String | Retrieves the foreground color setting. |
getForegroundColor(offset) | String | Retrieves the foreground color at the specified character offset. |
getLinkUrl() | String | Retrieves the link url. |
getLinkUrl(offset) | String | Retrieves the link URL at the specified character offset. |
getNextSibling() | Element | Retrieves the element's next sibling element. |
getParent() | ContainerElement | Retrieves the element's parent element. |
getPreviousSibling() | Element | Retrieves the element's previous sibling element. |
getText() | String | Retrieves the contents of the element as a text string. |
getTextAlignment() | TextAlignment | Gets the text alignment. |
getTextAlignment(offset) | TextAlignment | Gets the text alignment for a single character. |
getTextAttributeIndices() | Integer[] | Retrieves the set of text indices that correspond to the start of distinct text formatting runs. |
getType() | ElementType | Retrieves the element's ElementType . |
insertText(offset, text) | Text | Inserts the specified text at the given character offset. |
isAtDocumentEnd() | Boolean | Determines whether the element is at the end of the Document . |
isBold() | Boolean | Retrieves the bold setting. |
isBold(offset) | Boolean | Retrieves the bold setting at the specified character offset. |
isItalic() | Boolean | Retrieves the italic setting. |
isItalic(offset) | Boolean | Retrieves the italic setting at the specified character offset. |
isStrikethrough() | Boolean | Retrieves the strikethrough setting. |
isStrikethrough(offset) | Boolean | Retrieves the strikethrough setting at the specified character offset. |
isUnderline() | Boolean | Retrieves the underline setting. |
isUnderline(offset) | Boolean | Retrieves the underline setting at the specified character offset. |
merge() | Text | Merges the element with the preceding sibling of the same type. |
removeFromParent() | Text | Removes the element from its parent. |
replaceText(searchPattern, replacement) | Element | Replaces all occurrences of a given text pattern with a given replacement string, using regular expressions. |
setAttributes(startOffset, endOffsetInclusive, attributes) | Text | Applies the specified attributes to the given character range. |
setAttributes(attributes) | Text | Sets the element's attributes. |
setBackgroundColor(startOffset, endOffsetInclusive, color) | Text | Sets the background color for the specified character range. |
setBackgroundColor(color) | Text | Sets the background color. |
setBold(bold) | Text | Sets the bold setting. |
setBold(startOffset, endOffsetInclusive, bold) | Text | Sets the bold setting for the specified character range. |
setFontFamily(startOffset, endOffsetInclusive, fontFamilyName) | Text | Sets the font family for the specified character range. |
setFontFamily(fontFamilyName) | Text | Sets the font family. |
setFontSize(startOffset, endOffsetInclusive, size) | Text | Sets the font size for the specified character range. |
setFontSize(size) | Text | Sets the font size. |
setForegroundColor(startOffset, endOffsetInclusive, color) | Text | Sets the foreground color for the specified character range. |
setForegroundColor(color) | Text | Sets the foreground color. |
setItalic(italic) | Text | Sets the italic setting. |
setItalic(startOffset, endOffsetInclusive, italic) | Text | Sets the italic setting for the specified character range. |
setLinkUrl(startOffset, endOffsetInclusive, url) | Text | Sets the link URL for the specified character range. |
setLinkUrl(url) | Text | Sets the link url. |
setStrikethrough(strikethrough) | Text | Sets the strikethrough setting. |
setStrikethrough(startOffset, endOffsetInclusive, strikethrough) | Text | Sets the strikethrough setting for the specified character range. |
setText(text) | Text | Sets the text contents. |
setTextAlignment(startOffset, endOffsetInclusive, textAlignment) | Text | Sets the text alignment for a given character range. |
setTextAlignment(textAlignment) | Text | Sets the text alignment. |
setUnderline(underline) | Text | Sets the underline setting. |
setUnderline(startOffset, endOffsetInclusive, underline) | Text | Sets the underline setting for the specified character range. |
TextAlignment
Характеристики
Свойство | Тип | Описание |
---|---|---|
NORMAL | Enum | The normal text alignment. |
SUPERSCRIPT | Enum | The superscript text alignment. |
SUBSCRIPT | Enum | The subscript text alignment. |
UnsupportedElement
Methods
Method | Return type | Brief description |
---|---|---|
copy() | UnsupportedElement | Returns a detached, deep copy of the current element. |
getAttributes() | Object | Retrieves the element's attributes. |
getNextSibling() | Element | Retrieves the element's next sibling element. |
getParent() | ContainerElement | Retrieves the element's parent element. |
getPreviousSibling() | Element | Retrieves the element's previous sibling element. |
getType() | ElementType | Retrieves the element's ElementType . |
isAtDocumentEnd() | Boolean | Determines whether the element is at the end of the Document . |
merge() | UnsupportedElement | Merges the element with the preceding sibling of the same type. |
removeFromParent() | UnsupportedElement | Removes the element from its parent. |
setAttributes(attributes) | UnsupportedElement | Sets the element's attributes. |
VerticalAlignment
Характеристики
Свойство | Тип | Описание |
---|---|---|
BOTTOM | Enum | The bottom-alignment option. |
CENTER | Enum | The center-alignment option. |
TOP | Enum | The top-alignment option. |