Class InlineDrawing

Satır içiÇizim

Yerleştirilmiş bir çizimi temsil eden öğe. ListItem veya Paragraph, FootnoteSection içinde olmadığı sürece InlineDrawing, ListItem veya Paragraph içinde yer alabilir. Bir InlineDrawing öğesi başka bir öğe içeremez. Belge yapısı hakkında daha fazla bilgi için Google Dokümanlar'ı genişletme rehberine bakın.

Yöntemler

YöntemDönüş türüKısa açıklama
copy()InlineDrawingGeçerli öğenin ayrılmış, derin bir kopyasını döndürür.
getAltDescription()StringÇizimin alternatif açıklamasını döndürür.
getAltTitle()StringÇizimin alternatif başlığını döndürür.
getAttributes()ObjectÖğenin özelliklerini alır.
getNextSibling()ElementÖğenin sonraki kardeş öğesini alır.
getParent()ContainerElementÖğenin üst öğesini alır.
getPreviousSibling()ElementÖğenin önceki kardeş öğesini alır.
getType()ElementTypeÖğenin ElementType değerini alır.
isAtDocumentEnd()BooleanÖğenin Document sonunda olup olmadığını belirler.
merge()InlineDrawingÖğeyi, aynı türdeki önceki kardeş öğeyle birleştirir.
removeFromParent()InlineDrawingÖğeyi üst öğesinden kaldırır.
setAltDescription(description)InlineDrawingÇizimin alternatif açıklamasını ayarlar.
setAltTitle(title)InlineDrawingÇizimin alternatif başlığını ayarlar.
setAttributes(attributes)InlineDrawingÖğenin özelliklerini ayarlar.

Ayrıntılı belgeler

copy()

Geçerli öğenin ayrılmış, derin bir kopyasını döndürür.

Öğede bulunan tüm alt öğeler de kopyalanır. Yeni öğenin üst öğesi yok.

Return

InlineDrawing: Yeni kopya.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getAltDescription()

Çizimin alternatif açıklamasını döndürür.

Return

String: Alternatif açıklama veya öğenin alternatif açıklaması yoksa null.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getAltTitle()

Çizimin alternatif başlığını döndürür.

Return

String: Alternatif başlık veya öğenin alternatif başlığı yoksa null.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getAttributes()

Öğenin özelliklerini alır.

Sonuç, her geçerli öğe özelliği için bir özellik içeren bir nesnedir. Her özellik adı, DocumentApp.Attribute numaralandırmasındaki bir öğeye karşılık gelir.

const doc = DocumentApp.getActiveDocument(); const documentTab = doc.getActiveTab().asDocumentTab(); const body = documentTab.getBody();  // Append a styled paragraph. const par = body.appendParagraph('A bold, italicized paragraph.'); par.setBold(true); par.setItalic(true);  // Retrieve the paragraph's attributes. const atts = par.getAttributes();  // Log the paragraph attributes. for (const att in atts) {   Logger.log(`${att}:${atts[att]}`); }

Return

Object: Öğenin özellikleri.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getNextSibling()

Öğenin sonraki kardeş öğesini alır.

Bir sonraki kardeş öğe, aynı üst öğeye sahiptir ve geçerli öğeyi takip eder.

Return

Element: Sonraki kardeş öğe.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getParent()

Öğenin üst öğesini alır.

Üst öğe, geçerli öğeyi içerir.

Return

ContainerElement: Üst öğe.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getPreviousSibling()

Öğenin önceki kardeş öğesini alır.

Önceki kardeş öğe, aynı üst öğeye sahiptir ve geçerli öğeden önce gelir.

Return

Element: Önceki kardeş öğe.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getType()

Öğenin ElementType değerini alır.

Belirli bir öğenin tam türünü belirlemek için getType() kullanın.

const doc = DocumentApp.getActiveDocument(); const documentTab = doc.getActiveTab().asDocumentTab(); const body = documentTab.getBody();  // Obtain the first element in the active tab's body.  const firstChild = body.getChild(0);  // Use getType() to determine the element's type. if (firstChild.getType() === DocumentApp.ElementType.PARAGRAPH) {   Logger.log('The first element is a paragraph.'); } else {   Logger.log('The first element is not a paragraph.'); }

Return

ElementType: Öğe türü.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

isAtDocumentEnd()

Öğenin Document sonunda olup olmadığını belirler.

Return

Boolean: Öğenin sekmenin sonunda olup olmadığı.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

merge()

Öğeyi, aynı türdeki önceki kardeş öğeyle birleştirir.

Yalnızca aynı ElementType öğeleri birleştirilebilir. Geçerli öğede bulunan tüm alt öğeler, önceki kardeş öğeye taşınır.

Mevcut öğe dokümandan kaldırılır.

const doc = DocumentApp.getActiveDocument(); const documentTab = doc.getActiveTab().asDocumentTab(); const body = documentTab.getBody();  // Example 1: Merge paragraphs // Append two paragraphs to the document's active tab. const par1 = body.appendParagraph('Paragraph 1.'); const par2 = body.appendParagraph('Paragraph 2.'); // Merge the newly added paragraphs into a single paragraph. par2.merge();  // Example 2: Merge table cells // Create a two-dimensional array containing the table's cell contents. const cells = [   ['Row 1, Cell 1', 'Row 1, Cell 2'],   ['Row 2, Cell 1', 'Row 2, Cell 2'], ]; // Build a table from the array. const table = body.appendTable(cells); // Get the first row in the table. const row = table.getRow(0); // Get the two cells in this row. const cell1 = row.getCell(0); const cell2 = row.getCell(1); // Merge the current cell into its preceding sibling element. const merged = cell2.merge();

Return

InlineDrawing: Birleştirilmiş öğe.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

removeFromParent()

Öğeyi üst öğesinden kaldırır.

const doc = DocumentApp.getActiveDocument(); const documentTab = doc.getActiveTab().asDocumentTab(); const body = documentTab.getBody();  // Remove all images in the active tab's body. const imgs = body.getImages(); for (let i = 0; i < imgs.length; i++) {   imgs[i].removeFromParent(); }

Return

InlineDrawing: Kaldırılan öğe.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setAltDescription(description)

Çizimin alternatif açıklamasını ayarlar. Belirtilen açıklama null ise açıklamayı boş dize olarak ayarlar.

Parametreler

AdTürAçıklama
descriptionStringAlternatif açıklama.

Return

InlineDrawing: Geçerli nesne.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setAltTitle(title)

Çizimin alternatif başlığını ayarlar. Belirtilen başlık null ise başlığı boş dize olarak ayarlar.

Parametreler

AdTürAçıklama
titleStringAlternatif başlık.

Return

InlineDrawing: Geçerli nesne.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setAttributes(attributes)

Öğenin özelliklerini ayarlar.

Belirtilen özellikler parametresi, her özellik adının DocumentApp.Attribute numaralandırmasındaki bir öğe ve her özellik değerinin uygulanacak yeni değer olduğu bir nesne olmalıdır.

const doc = DocumentApp.getActiveDocument(); const documentTab = doc.getActiveTab().asDocumentTab(); const body = documentTab.getBody();  // Define a custom paragraph style. const style = {}; style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] =     DocumentApp.HorizontalAlignment.RIGHT; style[DocumentApp.Attribute.FONT_FAMILY] = 'Calibri'; style[DocumentApp.Attribute.FONT_SIZE] = 18; style[DocumentApp.Attribute.BOLD] = true;  // Append a plain paragraph. const par = body.appendParagraph('A paragraph with custom style.');  // Apply the custom style. par.setAttributes(style);

Parametreler

AdTürAçıklama
attributesObjectÖğenin özellikleri.

Return

InlineDrawing: Geçerli öğe.

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents