सूची में मौजूद किसी आइटम को दिखाने वाला एलिमेंट. ListItem
एक Paragraph
होता है, जो किसी सूची आईडी से जुड़ा होता है. ListItem
में Equation
, Footnote
, HorizontalRule
, InlineDrawing
, InlineImage
, PageBreak
, और Text
एलिमेंट शामिल हो सकते हैं. दस्तावेज़ की बनावट के बारे में ज़्यादा जानने के लिए, Google Docs की सीमा बढ़ाने की गाइड देखें.
ListItems
में नए-पंक्ति वाले वर्ण नहीं हो सकते. नई लाइन के वर्णों ("\n") को लाइन-ब्रेक वर्णों ("\r") में बदला जाता है.
एक ही सूची आईडी वाले ListItems
एक ही सूची से जुड़े हैं और उन्हें उसी हिसाब से नंबर दिए गए हैं.
किसी सूची के लिए, ListItems
को दस्तावेज़ के बगल में होना ज़रूरी नहीं है. इसके अलावा, उसका पैरंट एलिमेंट भी वही होना चाहिए. एक ही सूची के दो आइटम, एक ही क्रम में नंबर देते हुए दस्तावेज़ में कहीं भी मौजूद हो सकते हैं. इस उदाहरण में, नीचे दिए गए उदाहरण में बताया गया है:
var body = DocumentApp.getActiveDocument().getBody(); // Append a new list item to the body. var item1 = body.appendListItem('Item 1'); // Log the new list item's list ID. Logger.log(item1.getListId()); // Append a table after the list item. body.appendTable([ ['Cell 1', 'Cell 2'] ]); // Append a second list item with the same list ID. The two items are treated as the same list, // despite not being consecutive. var item2 = body.appendListItem('Item 2'); item2.setListId(item1);
तरीके
तरीका | रिटर्न टाइप | संक्षिप्त विवरण |
---|---|---|
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 | दिए गए चाइल्ड एलिमेंट के लिए चाइल्ड इंडेक्स फिर से हासिल करता है. |
getGlyphType() | GlyphType | सूची आइटम के GlyphType को फिर से लाता है. |
getHeading() | ParagraphHeading | ParagraphHeading को वापस लाता है. |
getIndentEnd() | Number | आखिरी इंडेंटेशन को पॉइंट में लाता है. |
getIndentFirstLine() | Number | पहली लाइन का इंडेंट फिर से हासिल करता है, पॉइंट में. |
getIndentStart() | Number | स्टार्ट इंडेंटेशन फिर से लाता है. |
getLineSpacing() | Number | लाइन के बीच की दूरी को पॉइंट में दिखाता है. |
getLinkUrl() | String | लिंक का यूआरएल वापस लाता है. |
getListId() | String | सूची का आईडी फिर से हासिल करता है. |
getNestingLevel() | Integer | सूची आइटम के नेस्टिंग स्तर फिर से हासिल करता है. |
getNextSibling() | Element | एलिमेंट का अगला सिबलिंग एलिमेंट वापस लाता है. |
getNumChildren() | Integer | बच्चों की संख्या फिर से हासिल करता है. |
getParent() | ContainerElement | एलिमेंट के पैरंट एलिमेंट को वापस लाता है. |
getPositionedImage(id) | PositionedImage | इमेज के आईडी के हिसाब से PositionedImage मिलता है. |
getPositionedImages() | PositionedImage[] | पैराग्राफ़ पर ऐंकर किए गए सभी PositionedImage ऑब्जेक्ट दिखाता है. |
getPreviousSibling() | Element | एलिमेंट के पिछले सिबलिंग एलिमेंट को फिर से लाता है. |
getSpacingAfter() | Number | एलिमेंट के बाद स्पेस को पॉइंट में लाता है. |
getSpacingBefore() | Number | एलिमेंट के पहले स्पेस को पॉइंट में दिखाता है. |
getText() | String | एलिमेंट के कॉन्टेंट को टेक्स्ट स्ट्रिंग के तौर पर वापस लाता है. |
getTextAlignment() | TextAlignment | टेक्स्ट अलाइनमेंट पाता है. |
getType() | ElementType | एलिमेंट के ElementType को फिर से लाता है. |
insertHorizontalRule(childIndex) | HorizontalRule | तय किए गए इंडेक्स पर HorizontalRule बनाता है और उसे शामिल करता है. |
insertInlineImage(childIndex, image) | InlineImage | तय किए गए इंडेक्स में, इमेज ब्लॉब से एक नया InlineImage बनाता और डालता है. |
insertInlineImage(childIndex, image) | InlineImage | दिए गए InlineImage को तय इंडेक्स में इंसर्ट करता है. |
insertPageBreak(childIndex) | PageBreak | तय किए गए इंडेक्स में नया PageBreak बनाता और डालें. |
insertPageBreak(childIndex, pageBreak) | PageBreak | दिए गए PageBreak को तय इंडेक्स में इंसर्ट करता है. |
insertText(childIndex, text) | Text | तय किए गए इंडेक्स में नया टेक्स्ट एलिमेंट बनाता और डालता है. |
insertText(childIndex, text) | Text | दिए गए Text एलिमेंट को तय टेक्स्ट कॉन्टेंट के साथ, तय किए गए इंडेक्स में शामिल करता है. |
isAtDocumentEnd() | Boolean | इससे पता चलता है कि एलिमेंट, Document के आखिर में है या नहीं. |
isLeftToRight() | Boolean | बाएं से दाएं की सेटिंग वापस लाता है. |
merge() | ListItem | एलिमेंट को उसी तरह के पिछले सिबलिंग के साथ मर्ज करता है. |
removeChild(child) | ListItem | चुने गए चाइल्ड एलिमेंट को हटाता है. |
removeFromParent() | ListItem | इसके पैरंट से एलिमेंट हटा देता है. |
removePositionedImage(id) | Boolean | इमेज के आईडी से PositionedImage को हटाता है. |
replaceText(searchPattern, replacement) | Element | रेगुलर एक्सप्रेशन का इस्तेमाल करके, दिए गए टेक्स्ट पैटर्न को किसी खास रिप्लेसमेंट स्ट्रिंग से बदलता है. |
setAlignment(alignment) | ListItem | HorizontalAlignment को सेट करता है. |
setAttributes(attributes) | ListItem | एलिमेंट के एट्रिब्यूट सेट करता है. |
setGlyphType(glyphType) | ListItem | सूची में मौजूद आइटम की GlyphType को सेट करता है. |
setHeading(heading) | ListItem | ParagraphHeading को सेट करता है. |
setIndentEnd(indentEnd) | ListItem | आखिरी इंडेंट सेट करता है, पॉइंट. |
setIndentFirstLine(indentFirstLine) | ListItem | पहली पंक्ति का इंडेंट सेट करता है, जिसे पॉइंट में सेट करता है. |
setIndentStart(indentStart) | ListItem | शुरुआती इंडेंट सेट करता है, पॉइंट. |
setLeftToRight(leftToRight) | ListItem | बाएं से दाएं की सेटिंग सेट करता है. |
setLineSpacing(multiplier) | ListItem | लाइन की बीच की दूरी को, संख्या के रूप में सेट करता है. यह स्पेसिंग के लिए इस्तेमाल की जाने वाली लाइनों की संख्या दिखाता है. |
setLinkUrl(url) | ListItem | लिंक का यूआरएल सेट करता है. |
setListId(listItem) | ListItem | सूची का आईडी सेट करता है. |
setNestingLevel(nestingLevel) | ListItem | सूची आइटम का नेस्टिंग स्तर सेट करता है. |
setSpacingAfter(spacingAfter) | ListItem | एलिमेंट के बाद स्पेस को पॉइंट में सेट करता है. |
setSpacingBefore(spacingBefore) | ListItem | एलिमेंट के पहले स्पेस को पॉइंट में सेट करता है. |
setText(text) | void | सूची आइटम की सामग्री को लेख के रूप में सेट करता है. |
setTextAlignment(textAlignment) | ListItem | टेक्स्ट अलाइनमेंट सेट करता है. |
ज़्यादा जानकारी के साथ दस्तावेज़
addPositionedImage(image)
यह इमेज ब्लॉब से नया PositionedImage
बनाता है और उसे शामिल करता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
image | BlobSource | इमेज का डेटा |
रिटर्न
PositionedImage
— पोज़िशन के लिए नई इमेज
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
appendHorizontalRule()
नया HorizontalRule
बनाता और जोड़ता है.
रिटर्न
HorizontalRule
— नया हॉरिज़ॉन्टल रूल
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
appendInlineImage(image)
दिए गए इमेज ब्लॉब से नया InlineImage
बनाता और जोड़ता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
image | BlobSource | इमेज का डेटा |
रिटर्न
InlineImage
— जोड़ी गई इमेज
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
appendInlineImage(image)
दिए गए InlineImage
को जोड़ता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
image | InlineImage | इमेज का डेटा |
रिटर्न
InlineImage
— जोड़ी गई इमेज
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
appendPageBreak()
नया PageBreak
बनाता और जोड़ता है.
ध्यान दें: हो सकता है कि PageBreaks
को TableCells
में शामिल न किया जाए.
अगर मौजूदा एलिमेंट किसी टेबल सेल में है, तो उसे अपवाद के तौर पर इस्तेमाल किया जा सकता है.
रिटर्न
PageBreak
— नया पेज ब्रेक एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
appendPageBreak(pageBreak)
दिए गए PageBreak
को जोड़ता है.
ध्यान दें: हो सकता है कि PageBreaks
को TableCells
में शामिल न किया जाए.
अगर मौजूदा एलिमेंट किसी टेबल सेल में है, तो उसे अपवाद के तौर पर इस्तेमाल किया जा सकता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
pageBreak | PageBreak | जोड़ने के लिए पेज ब्रेक |
रिटर्न
PageBreak
— जोड़ा गया पेज ब्रेक एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
appendText(text)
तय किए गए कॉन्टेंट के साथ नया Text
एलिमेंट बनाता और जोड़ता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
text | String | टेक्स्ट का कॉन्टेंट |
रिटर्न
Text
— नया टेक्स्ट एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
appendText(text)
दिए गए Text
एलिमेंट को जोड़ता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
text | Text | जोड़ने के लिए टेक्स्ट एलिमेंट |
रिटर्न
Text
— जोड़ा गया टेक्स्ट एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
clear()
copy()
मौजूदा एलिमेंट की डिटैच की गई और डीप कॉपी दिखाता है.
एलिमेंट में मौजूद सभी चाइल्ड एलिमेंट भी कॉपी हो जाते हैं. नए एलिमेंट में पैरंट एलिमेंट नहीं होता.
रिटर्न
ListItem
— नई कॉपी.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
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 | ब्यौरा |
---|---|---|
elementType | ElementType | खोजने के लिए एलिमेंट का टाइप |
रिटर्न
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 | ब्यौरा |
---|---|---|
elementType | ElementType | खोजने के लिए एलिमेंट का टाइप |
from | RangeElement | इससे खोज करने के लिए खोज नतीजा |
रिटर्न
RangeElement
— ऐसा खोज नतीजा जो सर्च एलिमेंट की अगली पोज़िशन के बारे में बताता है
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
findText(searchPattern)
रेगुलर एक्सप्रेशन का इस्तेमाल करके, तय टेक्स्ट पैटर्न के लिए एलिमेंट की सामग्री खोजता है.
JavaScript रेगुलर एक्सप्रेशन सुविधाओं का सबसेट पूरी तरह से काम नहीं करता, जैसे कि कैप्चर ग्रुप और मोड मॉडिफ़ायर.
दिए गए रेगुलर एक्सप्रेशन पैटर्न का मिलान, मौजूदा एलिमेंट में मौजूद हर टेक्स्ट ब्लॉक से स्वतंत्र रूप से किया जाता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
searchPattern | String | खोजने के लिए पैटर्न |
रिटर्न
RangeElement
— ऐसा खोज नतीजा जो खोज के टेक्स्ट की जगह दिखाता है या मेल न खाने पर, शून्य
होता है
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
findText(searchPattern, from)
दिए गए खोज के नतीजे से शुरू करते हुए, खास टेक्स्ट पैटर्न के लिए एलिमेंट का कॉन्टेंट खोजता है.
JavaScript रेगुलर एक्सप्रेशन सुविधाओं का सबसेट पूरी तरह से काम नहीं करता, जैसे कि कैप्चर ग्रुप और मोड मॉडिफ़ायर.
दिए गए रेगुलर एक्सप्रेशन पैटर्न का मिलान, मौजूदा एलिमेंट में मौजूद हर टेक्स्ट ब्लॉक से स्वतंत्र रूप से किया जाता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
searchPattern | String | खोजने के लिए पैटर्न |
from | RangeElement | इससे खोज करने के लिए खोज नतीजा |
रिटर्न
RangeElement
— ऐसा खोज नतीजा जो खोज के टेक्स्ट की अगली रैंक दिखाता है या मेल न खाने पर, शून्य
होता है
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getAlignment()
HorizontalAlignment
को वापस लाता है.
रिटर्न
HorizontalAlignment
— अलाइनमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
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 | ब्यौरा |
---|---|---|
childIndex | Integer | वापस लाने के लिए चाइल्ड एलिमेंट का इंडेक्स |
रिटर्न
Element
— तय किए गए इंडेक्स में चाइल्ड एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getChildIndex(child)
दिए गए चाइल्ड एलिमेंट के लिए चाइल्ड इंडेक्स फिर से हासिल करता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
child | Element | वह चाइल्ड एलिमेंट जिसके लिए इंडेक्स को फिर से पाना है |
रिटर्न
Integer
— चाइल्ड इंडेक्स
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getGlyphType()
getHeading()
ParagraphHeading
को वापस लाता है.
रिटर्न
ParagraphHeading
— शीर्षक
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getIndentEnd()
आखिरी इंडेंटेशन को पॉइंट में लाता है.
रिटर्न
Number
— आखिरी इंडेंट, पॉइंट में
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getIndentFirstLine()
पहली लाइन का इंडेंट फिर से हासिल करता है, पॉइंट में.
रिटर्न
Number
— पहली पंक्ति का इंडेंट, पॉइंट में
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getIndentStart()
स्टार्ट इंडेंटेशन फिर से लाता है.
रिटर्न
Number
— स्टार्ट इंडेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getLineSpacing()
लाइन के बीच की दूरी को पॉइंट में दिखाता है.
रिटर्न
Number
— लाइनों के बीच की दूरी, पॉइंट में
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getLinkUrl()
लिंक का यूआरएल वापस लाता है.
रिटर्न
String
— अगर एलिमेंट में इस एट्रिब्यूट के लिए एक से ज़्यादा वैल्यू हैं, तो लिंक यूआरएल या शून्य
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getListId()
सूची का आईडी फिर से हासिल करता है.
रिटर्न
String
— सूची का आईडी
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getNestingLevel()
सूची आइटम के नेस्टिंग स्तर फिर से हासिल करता है.
डिफ़ॉल्ट रूप से, सूची आइटम का नेस्टिंग स्तर शून्य होता है. नेस्टिंग स्तर वह ग्लिफ़ तय करते हैं जिसका सूची आइटम द्वारा उपयोग किया जाता है.
रिटर्न
Integer
— नेस्टिंग स्तर
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getNextSibling()
एलिमेंट का अगला सिबलिंग एलिमेंट वापस लाता है.
अगले सिबलिंग का एक ही पैरंट है और वह मौजूदा एलिमेंट को फ़ॉलो करता है.
रिटर्न
Element
— अगला सिबलिंग एलिमेंट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
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
getParent()
एलिमेंट के पैरंट एलिमेंट को वापस लाता है.
पैरंट एलिमेंट में मौजूदा एलिमेंट शामिल है.
रिटर्न
ContainerElement
— पैरंट एलिमेंट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getPositionedImage(id)
इमेज के आईडी के हिसाब से PositionedImage
मिलता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
id | String | इमेज आईडी |
रिटर्न
PositionedImage
— इमेज को पोज़िशन किया गया है
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getPositionedImages()
पैराग्राफ़ पर ऐंकर किए गए सभी PositionedImage
ऑब्जेक्ट दिखाता है.
रिटर्न
PositionedImage[]
— पोज़िशन की गई इमेज की सूची
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getPreviousSibling()
एलिमेंट के पिछले सिबलिंग एलिमेंट को फिर से लाता है.
पिछले सिबलिंग का पैरंट एलिमेंट एक ही है और यह मौजूदा एलिमेंट से पहले लागू है.
रिटर्न
Element
— पिछला सिबलिंग एलिमेंट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getSpacingAfter()
एलिमेंट के बाद स्पेस को पॉइंट में लाता है.
रिटर्न
Number
— एलिमेंट के बाद पॉइंट में स्पेस
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getSpacingBefore()
एलिमेंट के पहले स्पेस को पॉइंट में दिखाता है.
रिटर्न
Number
— एलिमेंट के पहले पॉइंट में स्पेस
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
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
बनाता है और उसे शामिल करता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
childIndex | Integer | वह इंडेक्स जिस पर एलिमेंट को डालना है |
रिटर्न
HorizontalRule
— नया हॉरिज़ॉन्टल रूल एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertInlineImage(childIndex, image)
तय किए गए इंडेक्स में, इमेज ब्लॉब से एक नया InlineImage
बनाता और डालता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
childIndex | Integer | वह इंडेक्स जिस पर एलिमेंट को डालना है |
image | BlobSource | इमेज का डेटा |
रिटर्न
InlineImage
— डाला गया इनलाइन इमेज एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertInlineImage(childIndex, image)
दिए गए InlineImage
को तय इंडेक्स में इंसर्ट करता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
childIndex | Integer | वह इंडेक्स जिस पर एलिमेंट को डालना है |
image | InlineImage | इमेज का डेटा |
रिटर्न
InlineImage
— डाला गया इनलाइन इमेज एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertPageBreak(childIndex)
तय किए गए इंडेक्स में नया PageBreak
बनाता और डालें.
ध्यान दें: हो सकता है कि PageBreaks
को TableCells
में शामिल न किया जाए.
अगर मौजूदा एलिमेंट किसी टेबल सेल में है, तो उसे अपवाद के तौर पर इस्तेमाल किया जा सकता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
childIndex | Integer | वह इंडेक्स जिस पर एलिमेंट को डालना है |
रिटर्न
PageBreak
— नया पेज ब्रेक एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertPageBreak(childIndex, pageBreak)
दिए गए PageBreak
को तय इंडेक्स में इंसर्ट करता है.
ध्यान दें: हो सकता है कि PageBreaks
को TableCells
में शामिल न किया जाए.
अगर मौजूदा एलिमेंट किसी टेबल सेल में है, तो उसे अपवाद के तौर पर इस्तेमाल किया जा सकता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
childIndex | Integer | वह इंडेक्स जिस पर एलिमेंट को डालना है |
pageBreak | PageBreak | पेज [aage ब्रेक] डालने के लिए |
रिटर्न
PageBreak
— डाला गया पेज ब्रेक एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertText(childIndex, text)
तय किए गए इंडेक्स में नया टेक्स्ट एलिमेंट बनाता और डालता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
childIndex | Integer | वह इंडेक्स जिस पर एलिमेंट को डालना है |
text | String | टेक्स्ट का कॉन्टेंट |
रिटर्न
Text
— नया टेक्स्ट एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertText(childIndex, text)
दिए गए Text
एलिमेंट को तय टेक्स्ट कॉन्टेंट के साथ, तय किए गए इंडेक्स में शामिल करता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
childIndex | Integer | वह इंडेक्स जिस पर एलिमेंट को डालना है |
text | Text | डाला जाने वाला टेक्स्ट एलिमेंट |
रिटर्न
Text
— डाला गया टेक्स्ट एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
isAtDocumentEnd()
इससे पता चलता है कि एलिमेंट, Document
के आखिर में है या नहीं.
रिटर्न
Boolean
— एलिमेंट, दस्तावेज़ के आखिर में है या नहीं.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
isLeftToRight()
बाएं से दाएं की सेटिंग वापस लाता है.
रिटर्न
Boolean
— बाईं से दाईं ओर वाली सेटिंग
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
merge()
एलिमेंट को उसी तरह के पिछले सिबलिंग के साथ मर्ज करता है.
एक ही ElementType
के एलिमेंट को ही मर्ज किया जा सकता है. मौजूदा एलिमेंट में शामिल सभी चाइल्ड एलिमेंट
को पिछले सिबलिंग एलिमेंट में ले जाया जाता है.
मौजूदा एलिमेंट, दस्तावेज़ से हटा दिया गया है.
var body = DocumentApp.getActiveDocument().getBody(); // Example 1: Merge paragraphs // Append two paragraphs to the document. var par1 = body.appendParagraph('Paragraph 1.'); var 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. var cells = [ ['Row 1, Cell 1', 'Row 1, Cell 2'], ['Row 2, Cell 1', 'Row 2, Cell 2'] ]; // Build a table from the array. var table = body.appendTable(cells); // Get the first row in the table. var row = table.getRow(0); // Get the two cells in this row. var cell1 = row.getCell(0); var cell2 = row.getCell(1); // Merge the current cell into its preceding sibling element. var merged = cell2.merge();
रिटर्न
ListItem
— मर्ज किया गया एलिमेंट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
removeChild(child)
चुने गए चाइल्ड एलिमेंट को हटाता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
child | Element | वह चाइल्ड एलिमेंट जिसे हटाना है |
रिटर्न
ListItem
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
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(); }
रिटर्न
ListItem
— हटाया गया एलिमेंट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
removePositionedImage(id)
इमेज के आईडी से PositionedImage
को हटाता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
id | String |
रिटर्न
Boolean
— भले ही, बताई गई इमेज हटाई गई हो या नहीं
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
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 | ब्यौरा |
---|---|---|
searchPattern | String | खोज करने के लिए रेगुलर एक्सप्रेशन पैटर्न |
replacement | String | बदले जाने के लिए इस्तेमाल किया जाने वाला टेक्स्ट |
रिटर्न
Element
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setAlignment(alignment)
HorizontalAlignment
को सेट करता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
alignment | HorizontalAlignment | हॉरिज़ॉन्टल अलाइनमेंट |
रिटर्न
ListItem
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
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 | ब्यौरा |
---|---|---|
attributes | Object | एलिमेंट के एट्रिब्यूट. |
रिटर्न
ListItem
— मौजूदा एलिमेंट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setGlyphType(glyphType)
सूची में मौजूद आइटम की GlyphType
को सेट करता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
glyphType | GlyphType | ग्लिफ़ टाइप |
रिटर्न
ListItem
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setHeading(heading)
ParagraphHeading
को सेट करता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
heading | ParagraphHeading | शीर्षक |
रिटर्न
ListItem
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setIndentEnd(indentEnd)
आखिरी इंडेंट सेट करता है, पॉइंट.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
indentEnd | Number | आखिरी इंडेंट, पॉइंट में |
रिटर्न
ListItem
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setIndentFirstLine(indentFirstLine)
पहली पंक्ति का इंडेंट सेट करता है, जिसे पॉइंट में सेट करता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
indentFirstLine | Number | पहली पंक्ति का इंडेंट, पॉइंट में |
रिटर्न
ListItem
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setIndentStart(indentStart)
शुरुआती इंडेंट सेट करता है, पॉइंट.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
indentStart | Number | शुरुआती इंडेंट, पॉइंट में |
रिटर्न
ListItem
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setLeftToRight(leftToRight)
बाएं से दाएं की सेटिंग सेट करता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
leftToRight | Boolean | बाईं से दाईं ओर की सेटिंग |
रिटर्न
ListItem
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setLineSpacing(multiplier)
लाइन की बीच की दूरी को, संख्या के रूप में सेट करता है. यह स्पेसिंग के लिए इस्तेमाल की जाने वाली लाइनों की संख्या दिखाता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
multiplier | Number | लाइनों की संख्या |
रिटर्न
ListItem
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setLinkUrl(url)
लिंक का यूआरएल सेट करता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
url | String | लिंक का यूआरएल |
रिटर्न
ListItem
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setListId(listItem)
सूची का आईडी सेट करता है.
सूची आईडी, दिए गए ListItem
के लिए एक ही वैल्यू पर सेट है. दोनों ListItems
को एक ही सूची के सदस्य माना जाएगा.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
listItem | ListItem | वह सूची आइटम जिसकी सूची आईडी का उपयोग किया जाना है |
रिटर्न
ListItem
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setNestingLevel(nestingLevel)
सूची आइटम का नेस्टिंग स्तर सेट करता है.
डिफ़ॉल्ट रूप से, सूची आइटम का नेस्टिंग स्तर शून्य होता है. नेस्टिंग स्तर वह ग्लिफ़ तय करते हैं जिसका सूची आइटम द्वारा उपयोग किया जाता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
nestingLevel | Integer | नेस्टिंग स्तर |
रिटर्न
ListItem
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setSpacingAfter(spacingAfter)
एलिमेंट के बाद स्पेस को पॉइंट में सेट करता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
spacingAfter | Number | एलिमेंट के बाद स्पेस को पॉइंट में |
रिटर्न
ListItem
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setSpacingBefore(spacingBefore)
एलिमेंट के पहले स्पेस को पॉइंट में सेट करता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
spacingBefore | Number | एलिमेंट के पहले खाली जगह, पॉइंट में |
रिटर्न
ListItem
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setText(text)
सूची आइटम की सामग्री को लेख के रूप में सेट करता है.
ध्यान दें: मौजूदा कॉन्टेंट मिटा दिया गया है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
text | String | नया टेक्स्ट कॉन्टेंट |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
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 | ब्यौरा |
---|---|---|
textAlignment | TextAlignment | लागू करने के लिए टेक्स्ट अलाइनमेंट का टाइप |
रिटर्न
ListItem
— मौजूदा एलिमेंट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents