Class Footnote

फ़ुटनोट

फ़ुटनोट दिखाने वाला एलिमेंट. हर Footnote, ListItem या Paragraph में होता है. साथ ही, फ़ुटनोट के कॉन्टेंट के लिए, एक FootnoteSection एलिमेंट होता है. Footnote में कोई दूसरा एलिमेंट नहीं हो सकता. दस्तावेज़ के स्ट्रक्चर के बारे में ज़्यादा जानने के लिए, Google Docs की समयसीमा बढ़ाने की गाइड देखें.

तरीके

तरीकारिटर्न टाइपसंक्षिप्त विवरण
copy()Footnoteमौजूदा एलिमेंट की डिटैच की गई और डीप कॉपी दिखाता है.
getAttributes()Objectएलिमेंट के एट्रिब्यूट वापस लाता है.
getFootnoteContents()FootnoteSectionफ़ुटनोट एलिमेंट का कॉन्टेंट वापस लाता है.
getNextSibling()Elementएलिमेंट का अगला सिबलिंग एलिमेंट वापस लाता है.
getParent()ContainerElementएलिमेंट के पैरंट एलिमेंट को वापस लाता है.
getPreviousSibling()Elementएलिमेंट के पिछले सिबलिंग एलिमेंट को फिर से लाता है.
getType()ElementTypeएलिमेंट के ElementType को फिर से लाता है.
isAtDocumentEnd()Booleanइससे पता चलता है कि एलिमेंट, Document के आखिर में है या नहीं.
removeFromParent()Footnoteइसके पैरंट से एलिमेंट हटा देता है.
setAttributes(attributes)Footnoteएलिमेंट के एट्रिब्यूट सेट करता है.

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

copy()

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

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

रिटर्न

Footnote — नई कॉपी.

अनुमति देना

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

  • 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

getFootnoteContents()

फ़ुटनोट एलिमेंट का कॉन्टेंट वापस लाता है.

रिटर्न

FootnoteSection — फ़ुटनोट सेक्शन

अनुमति देना

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

  • 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

isAtDocumentEnd()

इससे पता चलता है कि एलिमेंट, Document के आखिर में है या नहीं.

रिटर्न

Boolean — एलिमेंट, दस्तावेज़ के आखिर में है या नहीं.

अनुमति देना

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

  • 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();
}

रिटर्न

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

अनुमति देना

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

  • 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एलिमेंट के एट्रिब्यूट.

रिटर्न

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

अनुमति देना

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

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