Class FooterSection

FooterSection

फ़ुटर सेक्शन को दिखाने वाला एलिमेंट. आम तौर पर, Document में ज़्यादा से ज़्यादा एक FooterSection होता है. FooterSection में ListItem, Paragraph, और Table एलिमेंट शामिल हो सकते हैं. दस्तावेज़ की बनावट के बारे में ज़्यादा जानने के लिए, Google Docs की सीमा बढ़ाने की गाइड देखें.

तरीके

तरीकारिटर्न टाइपसंक्षिप्त विवरण
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हर स्ट्रिंग वैल्यू के लिए, TableCell वाला नया Table जोड़ता है.
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[]सेक्शन (ListItems सहित) में मौजूद सभी Paragraphs फिर से लाता है.
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टेक्स्ट अलाइनमेंट सेट करता है.

ज़्यादा जानकारी के साथ दस्तावेज़

appendHorizontalRule()

नया HorizontalRule बनाता और जोड़ता है.

HorizontalRule को नए Paragraph में शामिल किया जाएगा.

रिटर्न

HorizontalRule — नया हॉरिज़ॉन्टल रूल

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

appendImage(image)

दिए गए इमेज ब्लॉब से नया InlineImage बनाता और जोड़ता है.

इमेज नए Paragraph में शामिल होगी.

पैरामीटर

नामTypeब्यौरा
imageBlobSourceइमेज का डेटा

रिटर्न

InlineImage — जोड़ी गई इमेज

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

appendImage(image)

दिए गए InlineImage को जोड़ता है.

InlineImage को नए Paragraph में शामिल किया जाएगा.

किसी मौजूदा InlineImage की कॉपी जोड़ते समय, appendImage के इस वर्शन का इस्तेमाल करें.

पैरामीटर

नामTypeब्यौरा
imageInlineImageइमेज का डेटा

रिटर्न

InlineImage — जोड़ी गई इमेज

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

appendListItem(listItem)

दिए गए ListItem को जोड़ता है.

किसी मौजूदा ListItem की कॉपी जोड़ते समय, appendListItem के इस वर्शन का इस्तेमाल करें.

पैरामीटर

नामTypeब्यौरा
listItemListItemजोड़ने के लिए सूची आइटम

रिटर्न

ListItem — आइटम की सूची में जोड़ा गया

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

appendListItem(text)

नया ListItem बनाता और जोड़ता है. इसमें बताया गया टेक्स्ट कॉन्टेंट होता है.

सूची में शामिल आइटम को एक ही सूची के हिस्से के तौर पर जोड़ा जाता है.

पैरामीटर

नामTypeब्यौरा
textStringसूची आइटम के टेक्स्ट का कॉन्टेंट

रिटर्न

ListItem — सूची का नया आइटम

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

appendParagraph(paragraph)

दिए गए Paragraph को जोड़ता है.

किसी मौजूदा Paragraph की कॉपी जोड़ते समय, appendParagraph के इस वर्शन का इस्तेमाल करें.

पैरामीटर

नामTypeब्यौरा
paragraphParagraphपैराग्राफ़ को जोड़ें

रिटर्न

Paragraph — जोड़ा गया पैराग्राफ़

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

appendParagraph(text)

नया Paragraph बनाता और जोड़ता है. इसमें बताया गया टेक्स्ट कॉन्टेंट होता है.

पैरामीटर

नामTypeब्यौरा
textStringपैराग्राफ़ के टेक्स्ट का कॉन्टेंट

रिटर्न

Paragraph — नया पैराग्राफ़

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

appendTable()

नया Table बनाता और जोड़ता है.

इस तरीके से टेबल के बाद एक खाली पैराग्राफ़ भी जुड़ जाएगा, क्योंकि Google Docs के दस्तावेज़ों के आखिर में टेबल नहीं होगी.

रिटर्न

Table — नई टेबल

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

appendTable(cells)

हर स्ट्रिंग वैल्यू के लिए, TableCell वाला नया Table जोड़ता है.

इस तरीके से टेबल के बाद एक खाली पैराग्राफ़ भी जुड़ जाएगा, क्योंकि Google Docs के दस्तावेज़ों के आखिर में टेबल नहीं होगी.

पैरामीटर

नामTypeब्यौरा
cellsString[][]नई टेबल में जोड़ने के लिए, टेबल सेल का टेक्स्ट कॉन्टेंट

रिटर्न

Table — जोड़ी गई टेबल

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

appendTable(table)

दिए गए Table को जोड़ता है.

किसी मौजूदा Table की कॉपी जोड़ते समय, appendTable के इस वर्शन का इस्तेमाल करें. इस तरीके से टेबल के बाद एक खाली पैराग्राफ़ भी जुड़ जाएगा, क्योंकि Google Docs के दस्तावेज़ों के आखिर में टेबल नहीं होगी.

पैरामीटर

नामTypeब्यौरा
tableTableजोड़ने के लिए टेबल

रिटर्न

Table — जोड़ी गई टेबल

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

clear()

एलिमेंट के कॉन्टेंट को हटाता है.

रिटर्न

FooterSection — मौजूदा एलिमेंट


copy()

मौजूदा एलिमेंट की डिटैच की गई और डीप कॉपी दिखाता है.

एलिमेंट में मौजूद सभी चाइल्ड एलिमेंट भी कॉपी हो जाते हैं. नए एलिमेंट में पैरंट एलिमेंट नहीं होता.

रिटर्न

FooterSection — नई कॉपी.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

editAsText()

बदलाव करने के लिए, मौजूदा एलिमेंट का Text वर्शन लेता है.

एलिमेंट के कॉन्टेंट को रिच टेक्स्ट के रूप में बदलने के लिए, editAsText का इस्तेमाल करें. editAsText मोड, बिना टेक्स्ट वाले एलिमेंट (जैसे InlineImage और HorizontalRule) को अनदेखा करता है.

किसी मिटाई गई टेक्स्ट रेंज में शामिल चाइल्ड एलिमेंट, एलिमेंट से हटा दिए जाते हैं.

var body = DocumentApp.getActiveDocument().getBody();

// Insert two paragraphs separated by a paragraph containing an
// horizontal rule.
body.insertParagraph(0, "An editAsText sample.");
body.insertHorizontalRule(0);
body.insertParagraph(0, "An example.");

// Delete " sample.\n\n An" removing the horizontal rule in the process.
body.editAsText().deleteText(14, 25);

रिटर्न

Text — मौजूदा एलिमेंट का टेक्स्ट वर्शन


findElement(elementType)

किसी खास टाइप के डिसेंडेंट के लिए, एलिमेंट के कॉन्टेंट को खोजता है.

पैरामीटर

नामTypeब्यौरा
elementTypeElementTypeखोजने के लिए एलिमेंट का टाइप

रिटर्न

RangeElement — ऐसा खोज नतीजा जो खोज के नतीजे की जगह को दिखाता है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

findElement(elementType, from)

बताए गए RangeElement से शुरू करते हुए, किसी खास टाइप के डिसेंडेंट के लिए, एलिमेंट का कॉन्टेंट खोजता है.

// Get the body section of the active document.
var body = DocumentApp.getActiveDocument().getBody();

// Define the search parameters.
var searchType = DocumentApp.ElementType.PARAGRAPH;
var searchHeading = DocumentApp.ParagraphHeading.HEADING1;
var searchResult = null;

// Search until the paragraph is found.
while (searchResult = body.findElement(searchType, searchResult)) {
  var par = searchResult.getElement().asParagraph();
  if (par.getHeading() == searchHeading) {
    // Found one, update and stop.
    par.setText('This is the first header.');
    return;
  }
}

पैरामीटर

नामTypeब्यौरा
elementTypeElementTypeखोजने के लिए एलिमेंट का टाइप
fromRangeElementइससे खोज करने के लिए खोज नतीजा

रिटर्न

RangeElement — ऐसा खोज नतीजा जो सर्च एलिमेंट की अगली पोज़िशन के बारे में बताता है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

findText(searchPattern)

रेगुलर एक्सप्रेशन का इस्तेमाल करके, तय टेक्स्ट पैटर्न के लिए एलिमेंट की सामग्री खोजता है.

JavaScript रेगुलर एक्सप्रेशन सुविधाओं का सबसेट पूरी तरह से काम नहीं करता, जैसे कि कैप्चर ग्रुप और मोड मॉडिफ़ायर.

दिए गए रेगुलर एक्सप्रेशन पैटर्न का मिलान, मौजूदा एलिमेंट में मौजूद हर टेक्स्ट ब्लॉक से स्वतंत्र रूप से किया जाता है.

पैरामीटर

नामTypeब्यौरा
searchPatternStringखोजने के लिए पैटर्न

रिटर्न

RangeElement — ऐसा खोज नतीजा जो खोज के टेक्स्ट की जगह दिखाता है या मेल न खाने पर, शून्य होता है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

findText(searchPattern, from)

दिए गए खोज के नतीजे से शुरू करते हुए, खास टेक्स्ट पैटर्न के लिए एलिमेंट का कॉन्टेंट खोजता है.

JavaScript रेगुलर एक्सप्रेशन सुविधाओं का सबसेट पूरी तरह से काम नहीं करता, जैसे कि कैप्चर ग्रुप और मोड मॉडिफ़ायर.

दिए गए रेगुलर एक्सप्रेशन पैटर्न का मिलान, मौजूदा एलिमेंट में मौजूद हर टेक्स्ट ब्लॉक से स्वतंत्र रूप से किया जाता है.

पैरामीटर

नामTypeब्यौरा
searchPatternStringखोजने के लिए पैटर्न
fromRangeElementइससे खोज करने के लिए खोज नतीजा

रिटर्न

RangeElement — ऐसा खोज नतीजा जो खोज के टेक्स्ट की अगली रैंक दिखाता है या मेल न खाने पर, शून्य होता है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

getAttributes()

एलिमेंट के एट्रिब्यूट वापस लाता है.

नतीजा एक ऑब्जेक्ट होता है, जिसमें हर मान्य एलिमेंट एट्रिब्यूट के लिए एक प्रॉपर्टी होती है. यहां हर प्रॉपर्टी का नाम, DocumentApp.Attribute की गिनती में मौजूद किसी आइटम से मेल खाता है.

var body = DocumentApp.getActiveDocument().getBody();

// Append a styled paragraph.
var par = body.appendParagraph('A bold, italicized paragraph.');
par.setBold(true);
par.setItalic(true);

// Retrieve the paragraph's attributes.
var atts = par.getAttributes();

// Log the paragraph attributes.
for (var att in atts) {
  Logger.log(att + ":" + atts[att]);
}

रिटर्न

Object — एलिमेंट के एट्रिब्यूट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

getChild(childIndex)

तय किए गए चाइल्ड इंडेक्स में चाइल्ड एलिमेंट वापस लाता है.

// Get the body section of the active document.
var body = DocumentApp.getActiveDocument().getBody();

// Obtain the first element in the document.
var firstChild = body.getChild(0);

// If it's a paragraph, set its contents.
if (firstChild.getType() == DocumentApp.ElementType.PARAGRAPH) {
  firstChild.asParagraph().setText("This is the first paragraph.");
}

पैरामीटर

नामTypeब्यौरा
childIndexIntegerवापस लाने के लिए चाइल्ड एलिमेंट का इंडेक्स

रिटर्न

Element — तय किए गए इंडेक्स में चाइल्ड एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

getChildIndex(child)

दिए गए चाइल्ड एलिमेंट के लिए चाइल्ड इंडेक्स फिर से हासिल करता है.

पैरामीटर

नामTypeब्यौरा
childElementवह चाइल्ड एलिमेंट जिसके लिए इंडेक्स को फिर से पाना है

रिटर्न

Integer — चाइल्ड इंडेक्स

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

getImages()

सेक्शन में मौजूद सभी InlineImages वापस लाता है.

रिटर्न

InlineImage[] — सेक्शन इमेज

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

getListItems()

सेक्शन में मौजूद सभी ListItems वापस लाता है.

रिटर्न

ListItem[] — सेक्शन में मौजूद आइटम की सूची

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

getNumChildren()

बच्चों की संख्या फिर से हासिल करता है.

// Get the body section of the active document.
var body = DocumentApp.getActiveDocument().getBody();

// Log the number of elements in the document.
Logger.log("There are " + body.getNumChildren() +
    " elements in the document body.");

रिटर्न

Integer — बच्चों की संख्या

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

getParagraphs()

सेक्शन (ListItems सहित) में मौजूद सभी Paragraphs फिर से लाता है.

रिटर्न

Paragraph[] — सेक्शन के पैराग्राफ़

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

getParent()

एलिमेंट के पैरंट एलिमेंट को वापस लाता है.

पैरंट एलिमेंट में मौजूदा एलिमेंट शामिल है.

रिटर्न

ContainerElement — पैरंट एलिमेंट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

getTables()

सेक्शन में मौजूद सभी Tables वापस लाता है.

रिटर्न

Table[] — सेक्शन टेबल

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

getText()

एलिमेंट के कॉन्टेंट को टेक्स्ट स्ट्रिंग के तौर पर वापस लाता है.

रिटर्न

String — एलिमेंट का कॉन्टेंट, टेक्स्ट स्ट्रिंग के तौर पर

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

getTextAlignment()

टेक्स्ट अलाइनमेंट पाता है. अलाइनमेंट के ये टाइप उपलब्ध हैं: DocumentApp.TextAlignment.NORMAL, DocumentApp.TextAlignment.SUBSCRIPT, और DocumentApp.TextAlignment.SUPERSCRIPT.

रिटर्न

TextAlignment — टेक्स्ट अलाइनमेंट का टाइप या null अगर टेक्स्ट में कई तरह के टेक्स्ट अलाइनमेंट मौजूद हैं या टेक्स्ट अलाइनमेंट कभी सेट नहीं किया गया है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

getType()

एलिमेंट के ElementType को फिर से लाता है.

दिए गए एलिमेंट का सही टाइप पता करने के लिए, getType() का इस्तेमाल करें.

var body = DocumentApp.getActiveDocument().getBody();

// Obtain the first element in the document body.

var 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.');
}

रिटर्न

ElementType — एलिमेंट का टाइप.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

insertHorizontalRule(childIndex)

तय किए गए इंडेक्स में नया HorizontalRule बनाता और डालें.

HorizontalRule को नए Paragraph में शामिल किया जाएगा.

पैरामीटर

नामTypeब्यौरा
childIndexIntegerवह इंडेक्स जिस पर एलिमेंट को डालना है

रिटर्न

HorizontalRule — नया हॉरिज़ॉन्टल रूल

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

insertImage(childIndex, image)

तय किए गए इंडेक्स में, इमेज ब्लॉब से InlineImage बनाता है और उसे शामिल करता है.

पैरामीटर

नामTypeब्यौरा
childIndexIntegerवह इंडेक्स जिस पर एलिमेंट को डालना है
imageBlobSourceइमेज का डेटा

रिटर्न

InlineImage — शामिल की गई इनलाइन इमेज

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

insertImage(childIndex, image)

दिए गए InlineImage को तय इंडेक्स में इंसर्ट करता है.

इमेज नए Paragraph में शामिल होगी.

पैरामीटर

नामTypeब्यौरा
childIndexIntegerवह इंडेक्स जिस पर एलिमेंट को डालना है
imageInlineImageवह इमेज जिसे शामिल करना है

रिटर्न

InlineImage — शामिल की गई इनलाइन इमेज

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

insertListItem(childIndex, listItem)

दिए गए ListItem को तय इंडेक्स में इंसर्ट करता है.

पैरामीटर

नामTypeब्यौरा
childIndexIntegerवह इंडेक्स जिस पर
listItemListItemसम्मिलित करने के लिए सूची आइटम

रिटर्न

ListItem — सूची में शामिल किया गया आइटम

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

insertListItem(childIndex, text)

यह फ़ंक्शन तय किए गए टेक्स्ट कॉन्टेंट वाले इंडेक्स में एक नया ListItem बनाता है और उसे शामिल करता है.

पैरामीटर

नामTypeब्यौरा
childIndexIntegerवह इंडेक्स जिस पर
textStringसूची आइटम के टेक्स्ट का कॉन्टेंट

रिटर्न

ListItem — सूची का नया आइटम

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

insertParagraph(childIndex, paragraph)

दिए गए Paragraph को तय इंडेक्स में इंसर्ट करता है.

पैरामीटर

नामTypeब्यौरा
childIndexIntegerवह इंडेक्स जिस पर
paragraphParagraphवह पैराग्राफ़ जिसे शामिल करना है

रिटर्न

Paragraph — शामिल किया गया पैराग्राफ़

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

insertParagraph(childIndex, text)

यह फ़ंक्शन तय किए गए टेक्स्ट कॉन्टेंट वाले इंडेक्स में एक नया Paragraph बनाता है और उसे शामिल करता है.

पैरामीटर

नामTypeब्यौरा
childIndexIntegerवह इंडेक्स जिस पर
textStringपैराग्राफ़ के टेक्स्ट का कॉन्टेंट

रिटर्न

Paragraph — नया पैराग्राफ़

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

insertTable(childIndex)

तय किए गए इंडेक्स में नया Table बनाता और डालें.

पैरामीटर

नामTypeब्यौरा
childIndexIntegerवह इंडेक्स जिस पर

रिटर्न

Table — नई टेबल

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

insertTable(childIndex, cells)

तय किए गए इंडेक्स पर, तय सेल वाला नया Table बनाता है और शामिल करता है.

पैरामीटर

नामTypeब्यौरा
childIndexIntegerवह इंडेक्स जिस पर
cellsString[][]नई टेबल में जोड़ने के लिए, टेबल सेल का टेक्स्ट कॉन्टेंट

रिटर्न

Table — नई टेबल

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

insertTable(childIndex, table)

दिए गए Table को तय इंडेक्स में इंसर्ट करता है.

पैरामीटर

नामTypeब्यौरा
childIndexIntegerवह इंडेक्स जिस पर
tableTableजिस टेबल को शामिल करना है

रिटर्न

Table — शामिल की गई टेबल

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

removeChild(child)

चुने गए चाइल्ड एलिमेंट को हटाता है.

पैरामीटर

नामTypeब्यौरा
childElementवह चाइल्ड एलिमेंट जिसे हटाना है

रिटर्न

FooterSection — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

removeFromParent()

इसके पैरंट से एलिमेंट हटा देता है.

var body = DocumentApp.getActiveDocument().getBody();

// Remove all images in the document body.
var imgs = body.getImages();
for (var i = 0; i < imgs.length; i++) {
  imgs[i].removeFromParent();
}

रिटर्न

FooterSection — हटाया गया एलिमेंट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

replaceText(searchPattern, replacement)

रेगुलर एक्सप्रेशन का इस्तेमाल करके, दिए गए टेक्स्ट पैटर्न को किसी खास रिप्लेसमेंट स्ट्रिंग से बदलता है.

खोज पैटर्न को स्ट्रिंग के तौर पर पास किया जाता है, न कि JavaScript के रेगुलर एक्सप्रेशन ऑब्जेक्ट के तौर पर. इस वजह से आपको पैटर्न में किसी भी बैकस्लैश से बचने की ज़रूरत होगी.

यह तरीका, Google की RE2 रेगुलर एक्सप्रेशन लाइब्रेरी का इस्तेमाल करता है. इससे काम करने वाले सिंटैक्स को सीमित किया जाता है.

दिए गए रेगुलर एक्सप्रेशन पैटर्न का मिलान, मौजूदा एलिमेंट में मौजूद हर टेक्स्ट ब्लॉक से स्वतंत्र रूप से किया जाता है.

var body = DocumentApp.getActiveDocument().getBody();

// Clear the text surrounding "Apps Script", with or without text.
body.replaceText("^.*Apps ?Script.*$", "Apps Script");

पैरामीटर

नामTypeब्यौरा
searchPatternStringखोज करने के लिए रेगुलर एक्सप्रेशन पैटर्न
replacementStringबदले जाने के लिए इस्तेमाल किया जाने वाला टेक्स्ट

रिटर्न

Element — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

setAttributes(attributes)

एलिमेंट के एट्रिब्यूट सेट करता है.

बताया गया एट्रिब्यूट पैरामीटर एक ऐसा ऑब्जेक्ट होना चाहिए जहां हर प्रॉपर्टी का नाम, DocumentApp.Attribute इन्यूरेशन में मौजूद एक आइटम हो. साथ ही, हर प्रॉपर्टी की वैल्यू वह नई वैल्यू हो जिसे लागू किया जाना है.

var body = DocumentApp.getActiveDocument().getBody();

// Define a custom paragraph style.
var 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.
var par = body.appendParagraph('A paragraph with custom style.');

// Apply the custom style.
par.setAttributes(style);

पैरामीटर

नामTypeब्यौरा
attributesObjectएलिमेंट के एट्रिब्यूट.

रिटर्न

FooterSection — मौजूदा एलिमेंट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

setText(text)

कॉन्टेंट को सादे टेक्स्ट के तौर पर सेट करता है.

ध्यान दें: मौजूदा कॉन्टेंट मिटा दिया गया है.

पैरामीटर

नामTypeब्यौरा
textStringनया टेक्स्ट कॉन्टेंट

रिटर्न

FooterSection — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

setTextAlignment(textAlignment)

टेक्स्ट अलाइनमेंट सेट करता है. अलाइनमेंट के ये टाइप उपलब्ध हैं: DocumentApp.TextAlignment.NORMAL, DocumentApp.TextAlignment.SUBSCRIPT, और DocumentApp.TextAlignment.SUPERSCRIPT.

// Make the entire first paragraph be superscript.
var text = DocumentApp.getActiveDocument().getBody().getParagraphs()[0].editAsText();
text.setTextAlignment(DocumentApp.TextAlignment.SUPERSCRIPT);

पैरामीटर

नामTypeब्यौरा
textAlignmentTextAlignmentलागू करने के लिए टेक्स्ट अलाइनमेंट का टाइप

रिटर्न

FooterSection — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

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

काम न करने वाले तरीके