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 में शामिल किया जाएगा.

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

appendImage(image)

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

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

appendListItem(listItem)

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

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

पैरामीटर

नामटाइपब्यौरा
listItemListItemसूची में जोड़ा जाने वाला आइटम.

वापसी का टिकट

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

अनुमति देना

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

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

appendListItem(text)

तय किए गए टेक्स्ट कॉन्टेंट वाला नया ListItem बनाता और जोड़ता है.

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

appendParagraph(paragraph)

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

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

पैरामीटर

नामटाइपब्यौरा
paragraphParagraphजोड़ा जाने वाला पैराग्राफ़.

वापसी का टिकट

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

अनुमति देना

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

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

appendParagraph(text)

तय किए गए टेक्स्ट कॉन्टेंट वाला नया Paragraph बनाता और जोड़ता है.

पैरामीटर

नामटाइपब्यौरा
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 दस्तावेज़ टेबल के साथ खत्म नहीं हो सकता.

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

appendTable(table)

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

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

पैरामीटर

नामटाइपब्यौरा
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().getActiveTab().asDocumentTab().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)

बताए गए टाइप के डिसेंडेंट के लिए एलिमेंट की सामग्री खोजता है.

पैरामीटर

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

वापसी का टिकट

RangeElement — खोज के नतीजे में, खोज एलिमेंट की पोज़िशन के बारे में बताया जाता है.

अनुमति देना

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

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

findElement(elementType, from)

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

var body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().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;
  }
}

पैरामीटर

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

वापसी का टिकट

RangeElement — खोज का नतीजा, जो खोज एलिमेंट की अगली पोज़िशन दिखाता है.

अनुमति देना

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

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

findText(searchPattern)

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

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

findText(searchPattern, from)

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

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

getAttributes()

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

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

var doc = DocumentApp.getActiveDocument();
var documentTab = doc.getActiveTab().asDocumentTab();
var body = documentTab.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)

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

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

// Obtain the first element in the tab.
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.");
}

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

getChildIndex(child)

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

पैरामीटर

नामटाइपब्यौरा
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()

बच्चों की संख्या की जानकारी देता है.

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

// Log the number of elements in the tab.
Logger.log("There are " + body.getNumChildren() +
    " elements in the tab's 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 doc = DocumentApp.getActiveDocument();
var documentTab = doc.getActiveTab().asDocumentTab();
var body = documentTab.getBody();

// Obtain the first element in the active tab's 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 में शामिल किया जाएगा.

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertImage(childIndex, image)

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertImage(childIndex, image)

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

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertListItem(childIndex, listItem)

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

पैरामीटर

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

वापसी का टिकट

ListItem — डाला गया सूची आइटम.

अनुमति देना

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

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

insertListItem(childIndex, text)

तय किए गए इंडेक्स में, नया ListItem बनाता है और शामिल करता है. इसमें, दी गई जानकारी शामिल होती है टेक्स्ट कॉन्टेंट.

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertParagraph(childIndex, paragraph)

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertParagraph(childIndex, text)

तय किए गए इंडेक्स में, नया Paragraph बनाता है और शामिल करता है. इसमें, दी गई जानकारी शामिल होती है टेक्स्ट कॉन्टेंट.

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

insertTable(childIndex)

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

पैरामीटर

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

वापसी का टिकट

Table — नई टेबल.

अनुमति देना

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

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

insertTable(childIndex, cells)

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

पैरामीटर

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

वापसी का टिकट

Table — नई टेबल.

अनुमति देना

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

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

insertTable(childIndex, table)

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

removeChild(child)

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

removeFromParent()

एलिमेंट को इसकी पैरंट जगह से हटाता है.

var doc = DocumentApp.getActiveDocument();
var documentTab = doc.getActiveTab().asDocumentTab()
var body = documentTab.getBody();

// Remove all images in the active tab's 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().getActiveTab().asDocumentTab().getBody();

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

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setAttributes(attributes)

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

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

var doc = DocumentApp.getActiveDocument();
var documentTab = doc.getActiveTab().asDocumentTab();
var body = documentTab.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);

पैरामीटर

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

वापसी का टिकट

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

अनुमति देना

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

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

setText(text)

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

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

पैरामीटर

नामटाइपब्यौरा
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 in the active tab be superscript.
var documentTab = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab();
var text = documentTab.getBody().getParagraphs()[0].editAsText();
text.setTextAlignment(DocumentApp.TextAlignment.SUPERSCRIPT);

पैरामीटर

नामटाइपब्यौरा
textAlignmentTextAlignmentलागू किए जाने वाले लेख संरेखण का प्रकार

वापसी का टिकट

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

अनुमति देना

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

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

ऐसे तरीके जो अब काम नहीं करते