एम्बेड की गई इमेज को दिखाने वाला एलिमेंट. InlineImage
को
ListItem
या Paragraph
में शामिल किया जा सकता है, बशर्ते ListItem
या Paragraph
FootnoteSection
में न हो. InlineImage
में कोई अन्य एलिमेंट शामिल नहीं हो सकता. दस्तावेज़ की बनावट के बारे में ज़्यादा जानने के लिए, Google Docs की सीमा बढ़ाने की गाइड देखें.
तरीके
तरीका | रिटर्न टाइप | संक्षिप्त विवरण |
---|---|---|
copy() | InlineImage | मौजूदा एलिमेंट की डिटैच की गई और डीप कॉपी दिखाता है. |
getAltDescription() | String | इमेज का वैकल्पिक ब्यौरा दिखाता है. |
getAltTitle() | String | इमेज का वैकल्पिक टाइटल दिखाता है. |
getAs(contentType) | Blob | इस ऑब्जेक्ट के अंदर डेटा को, बताए गए कॉन्टेंट टाइप में बदले गए ब्लॉब के तौर पर दिखाएं. |
getAttributes() | Object | एलिमेंट के एट्रिब्यूट वापस लाता है. |
getBlob() | Blob | इस ऑब्जेक्ट के अंदर का डेटा, ब्लॉब के तौर पर दें. |
getHeight() | Integer | पिक्सल में इमेज की ऊंचाई लाता है. |
getLinkUrl() | String | लिंक का यूआरएल फिर से हासिल करता है. |
getNextSibling() | Element | एलिमेंट का अगला सिबलिंग एलिमेंट वापस लाता है. |
getParent() | ContainerElement | एलिमेंट के पैरंट एलिमेंट को वापस लाता है. |
getPreviousSibling() | Element | एलिमेंट के पिछले सिबलिंग एलिमेंट को फिर से लाता है. |
getType() | ElementType | एलिमेंट के ElementType को फिर से लाता है. |
getWidth() | Integer | पिक्सल में इमेज की चौड़ाई लाता है. |
isAtDocumentEnd() | Boolean | इससे पता चलता है कि एलिमेंट, Document के आखिर में है या नहीं. |
merge() | InlineImage | एलिमेंट को उसी तरह के पिछले सिबलिंग के साथ मर्ज करता है. |
removeFromParent() | InlineImage | इसके पैरंट से एलिमेंट हटा देता है. |
setAltDescription(description) | InlineImage | इमेज का वैकल्पिक ब्यौरा सेट करता है. |
setAltTitle(title) | InlineImage | इमेज का वैकल्पिक टाइटल सेट करता है. |
setAttributes(attributes) | InlineImage | एलिमेंट के एट्रिब्यूट सेट करता है. |
setHeight(height) | InlineImage | इमेज की ऊंचाई को पिक्सल में सेट करता है. |
setLinkUrl(url) | InlineImage | लिंक का यूआरएल सेट करता है. |
setWidth(width) | InlineImage | इमेज की चौड़ाई को पिक्सल में सेट करता है. |
ज़्यादा जानकारी के साथ दस्तावेज़
copy()
मौजूदा एलिमेंट की डिटैच की गई और डीप कॉपी दिखाता है.
एलिमेंट में मौजूद सभी चाइल्ड एलिमेंट भी कॉपी हो जाते हैं. नए एलिमेंट में पैरंट एलिमेंट नहीं होता.
रिटर्न
InlineImage
— नई कॉपी.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getAltDescription()
इमेज का वैकल्पिक ब्यौरा दिखाता है.
रिटर्न
String
— वैकल्पिक टाइटल या null
अगर एलिमेंट का दूसरा टाइटल नहीं दिया गया है
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getAltTitle()
इमेज का वैकल्पिक टाइटल दिखाता है.
रिटर्न
String
— वैकल्पिक टाइटल या null
अगर एलिमेंट का दूसरा टाइटल नहीं दिया गया है
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getAs(contentType)
इस ऑब्जेक्ट के अंदर डेटा को, बताए गए कॉन्टेंट टाइप में बदले गए ब्लॉब के तौर पर दिखाएं. इस तरीका से फ़ाइल नाम में सही एक्सटेंशन जोड़ा जा सकता है—उदाहरण के लिए, "myfile.pdf". हालांकि, यह माना जाता है कि फ़ाइल नाम का वह हिस्सा जो पिछली अवधि (अगर कोई है) के बाद आता है, तो वह मौजूदा एक्सटेंशन है जिसे बदला जाना चाहिए. इस वजह से, "ShoppingList.12.25.2014", "ShoppingList.12.25.pdf" हो जाता है.
कन्वर्ज़न के रोज़ के कोटा देखने के लिए, Google Services के लिए कोटा देखें. हाल ही में बनाए गए Google Workspace डोमेन पर, कुछ समय के लिए सख्त कोटे लागू हो सकते हैं.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
contentType | String | वह MIME टाइप जिसमें बदलना है. ज़्यादातर ब्लॉब के लिए, सिर्फ़ 'application/pdf' ही मान्य विकल्प है. BMP, GIF, JPEG या PNG फ़ॉर्मैट में मौजूद इमेज के लिए, 'image/bmp' , 'image/gif' , 'image/jpeg' या 'image/png' में से कोई भी मान्य है. |
रिटर्न
Blob
— ब्लॉब के तौर पर डेटा.
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
getBlob()
getHeight()
पिक्सल में इमेज की ऊंचाई लाता है.
रिटर्न
Integer
— इमेज की ऊंचाई, पिक्सल में
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getLinkUrl()
लिंक का यूआरएल फिर से हासिल करता है.
रिटर्न
String
— लिंक यूआरएल या null
अगर एलिमेंट में इस एट्रिब्यूट के लिए एक से ज़्यादा वैल्यू हैं.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
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
getParent()
एलिमेंट के पैरंट एलिमेंट को वापस लाता है.
पैरंट एलिमेंट में मौजूदा एलिमेंट शामिल है.
रिटर्न
ContainerElement
— पैरंट एलिमेंट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
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
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
getWidth()
पिक्सल में इमेज की चौड़ाई लाता है.
रिटर्न
Integer
— इमेज की चौड़ाई, पिक्सल में
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
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
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();
रिटर्न
InlineImage
— मर्ज किया गया एलिमेंट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
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(); }
रिटर्न
InlineImage
— हटाया गया एलिमेंट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setAltDescription(description)
इमेज का वैकल्पिक ब्यौरा सेट करता है. अगर दिया गया टाइटल null
है, तो ब्यौरे को खाली स्ट्रिंग पर सेट करें.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
description | String | वैकल्पिक शीर्षक |
रिटर्न
InlineImage
— मौजूदा ऑब्जेक्ट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setAltTitle(title)
इमेज का वैकल्पिक टाइटल सेट करता है. अगर दिया गया टाइटल null
है, तो टाइटल को खाली स्ट्रिंग पर सेट करें.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
title | String | वैकल्पिक शीर्षक |
रिटर्न
InlineImage
— मौजूदा ऑब्जेक्ट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
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 | एलिमेंट के एट्रिब्यूट. |
रिटर्न
InlineImage
— मौजूदा एलिमेंट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setHeight(height)
इमेज की ऊंचाई को पिक्सल में सेट करता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
height | Integer | इमेज की ऊंचाई, पिक्सल में |
रिटर्न
InlineImage
— मौजूदा ऑब्जेक्ट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setLinkUrl(url)
लिंक का यूआरएल सेट करता है. अगर दिया गया यूआरएल null
है या कोई खाली स्ट्रिंग है, तो यह तरीका खाली यूआरएल वाला एक लिंक बनाएगा, जिसे Google Docs में "अमान्य लिंक" के तौर पर दिखाया जा सकता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
url | String | लिंक का यूआरएल |
रिटर्न
InlineImage
— मौजूदा ऑब्जेक्ट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setWidth(width)
इमेज की चौड़ाई को पिक्सल में सेट करता है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
width | Integer | इमेज की चौड़ाई, पिक्सल में |
रिटर्न
InlineImage
— मौजूदा ऑब्जेक्ट
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents