Class Text

পাঠ্য

একটি সমৃদ্ধ পাঠ্য অঞ্চলের প্রতিনিধিত্বকারী একটি উপাদান৷ একটি Document সমস্ত পাঠ্য Text উপাদানগুলির মধ্যে রয়েছে৷ একটি Text উপাদান একটি Equation , EquationFunction , ListItem , বা Paragraph মধ্যে ধারণ করা যেতে পারে, কিন্তু নিজেই অন্য কোনো উপাদান ধারণ করতে পারে না। দস্তাবেজ গঠন সম্পর্কে আরও তথ্যের জন্য, Google ডক্স প্রসারিত করার নির্দেশিকা দেখুন।

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

// Use editAsText to obtain a single text element containing
// all the characters in the document.
var text = body.editAsText();

// Insert text at the beginning of the document.
text.insertText(0, 'Inserted text.\n');

// Insert text at the end of the document.
text.appendText('\nAppended text.');

// Make the first half of the document blue.
text.setForegroundColor(0, text.getText().length / 2, '#00FFFF');

পদ্ধতি

পদ্ধতি রিটার্ন টাইপ সংক্ষিপ্ত বর্ণনা
appendText(text) Text এই পাঠ্য অঞ্চলের শেষে নির্দিষ্ট পাঠ্য যোগ করে।
copy() Text বর্তমান উপাদানের একটি বিচ্ছিন্ন, গভীর অনুলিপি প্রদান করে।
deleteText(startOffset, endOffsetInclusive) Text পাঠ্যের একটি পরিসীমা মুছে দেয়।
editAsText() Text সম্পাদনার জন্য বর্তমান উপাদানটির একটি Text সংস্করণ পায়।
findText(searchPattern) RangeElement রেগুলার এক্সপ্রেশন ব্যবহার করে নির্দিষ্ট টেক্সট প্যাটার্নের জন্য উপাদানের বিষয়বস্তু অনুসন্ধান করে।
findText(searchPattern, from) RangeElement একটি প্রদত্ত অনুসন্ধান ফলাফল থেকে শুরু করে, নির্দিষ্ট পাঠ্য প্যাটার্নের জন্য উপাদানের বিষয়বস্তু অনুসন্ধান করে।
getAttributes() Object উপাদানের বৈশিষ্ট্য পুনরুদ্ধার করে।
getAttributes(offset) Object নির্দিষ্ট অক্ষর অফসেটে বৈশিষ্ট্য পুনরুদ্ধার করে।
getBackgroundColor() String ব্যাকগ্রাউন্ড কালার সেটিং পুনরুদ্ধার করে।
getBackgroundColor(offset) String নির্দিষ্ট অক্ষর অফসেটে পটভূমির রঙ পুনরুদ্ধার করে।
getFontFamily() String ফন্ট ফ্যামিলি সেটিং পুনরুদ্ধার করে।
getFontFamily(offset) String নির্দিষ্ট অক্ষর অফসেটে ফন্ট পরিবার পুনরুদ্ধার করে।
getFontSize() Number ফন্ট সাইজ সেটিং পুনরুদ্ধার করে।
getFontSize(offset) Number নির্দিষ্ট অক্ষর অফসেটে ফন্টের আকার পুনরুদ্ধার করে।
getForegroundColor() String ফোরগ্রাউন্ড কালার সেটিং পুনরুদ্ধার করে।
getForegroundColor(offset) String নির্দিষ্ট অক্ষর অফসেটে অগ্রভাগের রঙ পুনরুদ্ধার করে।
getLinkUrl() String লিঙ্ক url পুনরুদ্ধার করে.
getLinkUrl(offset) String নির্দিষ্ট অক্ষর অফসেটে লিঙ্ক URL পুনরুদ্ধার করে।
getNextSibling() Element উপাদানটির পরবর্তী সহোদর উপাদানটি পুনরুদ্ধার করে৷
getParent() ContainerElement উপাদানটির মূল উপাদান পুনরুদ্ধার করে।
getPreviousSibling() Element উপাদানটির পূর্ববর্তী ভাইবোন উপাদান পুনরুদ্ধার করে।
getText() String একটি পাঠ্য স্ট্রিং হিসাবে উপাদানের বিষয়বস্তু পুনরুদ্ধার করে।
getTextAlignment() TextAlignment পাঠ্য প্রান্তিককরণ পায়।
getTextAlignment(offset) TextAlignment একটি একক অক্ষরের জন্য পাঠ্য প্রান্তিককরণ পায়।
getTextAttributeIndices() Integer[] স্বতন্ত্র টেক্সট ফরম্যাটিং রানের শুরুর সাথে সঙ্গতিপূর্ণ টেক্সট সূচকের সেট পুনরুদ্ধার করে।
getType() ElementType উপাদানটির ElementType পুনরুদ্ধার করে।
insertText(offset, text) Text প্রদত্ত অক্ষর অফসেটে নির্দিষ্ট পাঠ্য সন্নিবেশ করান।
isAtDocumentEnd() Boolean উপাদানটি Document শেষে আছে কিনা তা নির্ধারণ করে।
isBold() Boolean সাহসী সেটিং পুনরুদ্ধার করে।
isBold(offset) Boolean নির্দিষ্ট অক্ষর অফসেটে বোল্ড সেটিং পুনরুদ্ধার করে।
isItalic() Boolean তির্যক সেটিং পুনরুদ্ধার করে।
isItalic(offset) Boolean নির্দিষ্ট অক্ষর অফসেটে তির্যক সেটিং পুনরুদ্ধার করে।
isStrikethrough() Boolean স্ট্রাইকথ্রু সেটিং পুনরুদ্ধার করে।
isStrikethrough(offset) Boolean নির্দিষ্ট অক্ষর অফসেটে স্ট্রাইকথ্রু সেটিং পুনরুদ্ধার করে।
isUnderline() Boolean আন্ডারলাইন সেটিং পুনরুদ্ধার করে।
isUnderline(offset) Boolean নির্দিষ্ট অক্ষর অফসেটে আন্ডারলাইন সেটিং পুনরুদ্ধার করে।
merge() Text একই ধরনের পূর্ববর্তী ভাইবোনের সাথে উপাদানটিকে মার্জ করে।
removeFromParent() Text উপাদানটিকে তার অভিভাবক থেকে সরিয়ে দেয়।
replaceText(searchPattern, replacement) Element রেগুলার এক্সপ্রেশন ব্যবহার করে একটি প্রদত্ত টেক্সট প্যাটার্নের সমস্ত ঘটনাকে একটি প্রদত্ত প্রতিস্থাপন স্ট্রিং দিয়ে প্রতিস্থাপন করে।
setAttributes(startOffset, endOffsetInclusive, attributes) Text প্রদত্ত অক্ষর পরিসরে নির্দিষ্ট বৈশিষ্ট্যগুলি প্রয়োগ করে।
setAttributes(attributes) Text উপাদানের বৈশিষ্ট্য সেট করে।
setBackgroundColor(startOffset, endOffsetInclusive, color) Text নির্দিষ্ট অক্ষর পরিসরের জন্য পটভূমির রঙ সেট করে।
setBackgroundColor(color) Text পটভূমির রঙ সেট করে।
setBold(bold) Text বোল্ড সেটিং সেট করে।
setBold(startOffset, endOffsetInclusive, bold) Text নির্দিষ্ট অক্ষর পরিসরের জন্য বোল্ড সেটিং সেট করে।
setFontFamily(startOffset, endOffsetInclusive, fontFamilyName) Text নির্দিষ্ট অক্ষর পরিসরের জন্য ফন্ট পরিবার সেট করে।
setFontFamily(fontFamilyName) Text ফন্ট পরিবার সেট করে।
setFontSize(startOffset, endOffsetInclusive, size) Text নির্দিষ্ট অক্ষর পরিসরের জন্য ফন্টের আকার সেট করে।
setFontSize(size) Text ফন্ট সাইজ সেট করে।
setForegroundColor(startOffset, endOffsetInclusive, color) Text নির্দিষ্ট অক্ষর পরিসরের জন্য অগ্রভাগের রঙ সেট করে।
setForegroundColor(color) Text অগ্রভাগের রঙ সেট করে।
setItalic(italic) Text তির্যক সেটিং সেট করে।
setItalic(startOffset, endOffsetInclusive, italic) Text নির্দিষ্ট অক্ষর পরিসরের জন্য তির্যক সেটিং সেট করে।
setLinkUrl(startOffset, endOffsetInclusive, url) Text নির্দিষ্ট অক্ষর পরিসরের জন্য লিঙ্ক URL সেট করে।
setLinkUrl(url) Text লিঙ্ক url সেট করে।
setStrikethrough(strikethrough) Text স্ট্রাইকথ্রু সেটিং সেট করে।
setStrikethrough(startOffset, endOffsetInclusive, strikethrough) Text নির্দিষ্ট অক্ষর পরিসরের জন্য স্ট্রাইকথ্রু সেটিং সেট করে।
setText(text) Text পাঠ্য বিষয়বস্তু সেট করে।
setTextAlignment(startOffset, endOffsetInclusive, textAlignment) Text একটি প্রদত্ত অক্ষর পরিসরের জন্য পাঠ্য সারিবদ্ধকরণ সেট করে।
setTextAlignment(textAlignment) Text পাঠ্য সারিবদ্ধকরণ সেট করে।
setUnderline(underline) Text আন্ডারলাইন সেটিং সেট করে।
setUnderline(startOffset, endOffsetInclusive, underline) Text নির্দিষ্ট অক্ষর পরিসরের জন্য আন্ডারলাইন সেটিং সেট করে।

বিস্তারিত ডকুমেন্টেশন

appendText(text)

এই পাঠ্য অঞ্চলের শেষে নির্দিষ্ট পাঠ্য যোগ করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Adds the text, 'Sample body text,' to the end of the document body.
const text = body.editAsText().appendText('Sample body text');

পরামিতি

নাম টাইপ বর্ণনা
text String যোগ করার জন্য পাঠ্য।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

copy()

বর্তমান উপাদানের একটি বিচ্ছিন্ন, গভীর অনুলিপি প্রদান করে।

উপাদান উপস্থিত কোনো শিশু উপাদান এছাড়াও অনুলিপি করা হয়. নতুন উপাদানটির কোনো অভিভাবক নেই৷

প্রত্যাবর্তন

Text - নতুন অনুলিপি।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

deleteText(startOffset, endOffsetInclusive)

পাঠ্যের একটি পরিসীমা মুছে দেয়।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
 const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Deletes the first 10 characters in the body.
 const text = body.editAsText().deleteText(0, 9);

পরামিতি

নাম টাইপ বর্ণনা
startOffset Integer মুছে ফেলার জন্য প্রথম অক্ষরের অফসেট অক্ষর।
endOffsetInclusive Integer মুছে ফেলার শেষ অক্ষরের অফসেট অক্ষর।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

  • 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 - বর্তমান উপাদানের একটি পাঠ্য সংস্করণ


findText(searchPattern)

রেগুলার এক্সপ্রেশন ব্যবহার করে নির্দিষ্ট টেক্সট প্যাটার্নের জন্য উপাদানের বিষয়বস্তু অনুসন্ধান করে।

জাভাস্ক্রিপ্ট রেগুলার এক্সপ্রেশন বৈশিষ্ট্যগুলির একটি উপসেট সম্পূর্ণরূপে সমর্থিত নয়, যেমন ক্যাপচার গ্রুপ এবং মোড মডিফায়ার।

প্রদত্ত রেগুলার এক্সপ্রেশন প্যাটার্নটি বর্তমান উপাদানে থাকা প্রতিটি টেক্সট ব্লকের সাথে স্বাধীনভাবে মিলে যায়।

পরামিতি

নাম টাইপ বর্ণনা
searchPattern String অনুসন্ধান করার জন্য প্যাটার্ন

প্রত্যাবর্তন

RangeElement — একটি অনুসন্ধান ফলাফল অনুসন্ধান পাঠ্যের অবস্থান নির্দেশ করে, অথবা যদি কোনো মিল না থাকে তাহলে শূন্য

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

findText(searchPattern, from)

একটি প্রদত্ত অনুসন্ধান ফলাফল থেকে শুরু করে, নির্দিষ্ট পাঠ্য প্যাটার্নের জন্য উপাদানের বিষয়বস্তু অনুসন্ধান করে।

জাভাস্ক্রিপ্ট রেগুলার এক্সপ্রেশন বৈশিষ্ট্যগুলির একটি উপসেট সম্পূর্ণরূপে সমর্থিত নয়, যেমন ক্যাপচার গ্রুপ এবং মোড মডিফায়ার।

প্রদত্ত রেগুলার এক্সপ্রেশন প্যাটার্নটি বর্তমান উপাদানে থাকা প্রতিটি টেক্সট ব্লকের সাথে স্বাধীনভাবে মিলে যায়।

পরামিতি

নাম টাইপ বর্ণনা
searchPattern String অনুসন্ধান করার জন্য প্যাটার্ন
from RangeElement অনুসন্ধান ফলাফল থেকে অনুসন্ধান

প্রত্যাবর্তন

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

getAttributes(offset)

নির্দিষ্ট অক্ষর অফসেটে বৈশিষ্ট্য পুনরুদ্ধার করে।

ফলাফল হল প্রতিটি বৈধ টেক্সট অ্যাট্রিবিউটের জন্য একটি প্রপার্টি ধারণকারী একটি বস্তু যেখানে প্রতিটি সম্পত্তির নাম DocumentApp.Attribute গণনার একটি আইটেমের সাথে মিলে যায়।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Declares style attributes.
const style = {}
style[DocumentApp.Attribute.BOLD] = true;
style[DocumentApp.Attribute.ITALIC] = true;
style[DocumentApp.Attribute.FONT_SIZE] = 29;

// Sets the style attributes to the document body.
const text = body.editAsText();
text.setAttributes(style);

// Gets the style attributes applied to the eleventh character in the
// body and logs them to the console.
const attributes = text.getAttributes(10);
console.log(attributes);

পরামিতি

নাম টাইপ বর্ণনা
offset Integer চরিত্র অফসেট.

প্রত্যাবর্তন

Object - উপাদানের বৈশিষ্ট্য।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getBackgroundColor()

ব্যাকগ্রাউন্ড কালার সেটিং পুনরুদ্ধার করে।

প্রত্যাবর্তন

String — পটভূমির রঙ, সিএসএস স্বরলিপিতে ফর্ম্যাট করা (যেমন '#ffffff' ), অথবা যদি উপাদানটিতে এই বৈশিষ্ট্যের জন্য একাধিক মান থাকে তাহলে শূন্য

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getBackgroundColor(offset)

নির্দিষ্ট অক্ষর অফসেটে পটভূমির রঙ পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456');

// Gets the document body.
const body = doc.getBody();

// Sets the background color of the first 3 characters in the body.
const text = body.editAsText().setBackgroundColor(0, 2, '#FFC0CB');

// Gets the background color of the first character in the body.
const backgroundColor = text.getBackgroundColor(0);

// Logs the background color to the console.
console.log(backgroundColor);

পরামিতি

নাম টাইপ বর্ণনা
offset Integer চরিত্র অফসেট.

প্রত্যাবর্তন

String — পটভূমির রঙ, CSS স্বরলিপিতে বিন্যাসিত (যেমন '#ffffff' )।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getFontFamily()

ফন্ট ফ্যামিলি সেটিং পুনরুদ্ধার করে। নামটি ডক্স বা Google ফন্টের ফন্ট মেনু থেকে যেকোনো ফন্ট হতে পারে এবং এটি কেস-সংবেদনশীল। getFontFamily() এবং setFontFamily(fontFamilyName) পদ্ধতিগুলি এখন FontFamily enum-এর পরিবর্তে ফন্টের জন্য স্ট্রিং নাম ব্যবহার করে। যদিও এই enumটি অবমূল্যায়িত করা হয়েছে, এটি পুরানো স্ক্রিপ্টগুলির সাথে সামঞ্জস্যের জন্য উপলব্ধ থাকবে।

প্রত্যাবর্তন

String — ফন্ট ফ্যামিলি, বা নাল যদি এলিমেন্টে এই অ্যাট্রিবিউটের একাধিক মান থাকে

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getFontFamily(offset)

নির্দিষ্ট অক্ষর অফসেটে ফন্ট পরিবার পুনরুদ্ধার করে। নামটি ডক্স বা Google ফন্টের ফন্ট মেনু থেকে যেকোনো ফন্ট হতে পারে এবং এটি কেস-সংবেদনশীল। getFontFamily() এবং setFontFamily(fontFamilyName) পদ্ধতিগুলি এখন FontFamily enum-এর পরিবর্তে ফন্টের জন্য স্ট্রিং নাম ব্যবহার করে। যদিও এই enumটি অবমূল্যায়িত করা হয়েছে, এটি পুরানো স্ক্রিপ্টগুলির সাথে সামঞ্জস্যের জন্য উপলব্ধ থাকবে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Sets the font of the first 16 characters to Impact.
const text = body.editAsText().setFontFamily(0, 15, 'Impact');

// Gets the font family of the 16th character in the document body.
const fontFamily = text.getFontFamily(15);

// Logs the font family to the console.
console.log(fontFamily);

পরামিতি

নাম টাইপ বর্ণনা
offset Integer চরিত্র অফসেট.

প্রত্যাবর্তন

String - ফন্ট পরিবার।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getFontSize()

ফন্ট সাইজ সেটিং পুনরুদ্ধার করে।

প্রত্যাবর্তন

Number — ফন্টের আকার, বা শূন্য যদি উপাদানটিতে এই বৈশিষ্ট্যের জন্য একাধিক মান থাকে

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getFontSize(offset)

নির্দিষ্ট অক্ষর অফসেটে ফন্টের আকার পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Sets the font size of the first 13 characters to 15.
const text = body.editAsText().setFontSize(0, 12, 15);

// Gets the font size of the first character.
const fontSize = text.getFontSize(0);

// Logs the font size to the console.
console.log(fontSize);

পরামিতি

নাম টাইপ বর্ণনা
offset Integer চরিত্র অফসেট.

প্রত্যাবর্তন

Number - ফন্টের আকার।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getForegroundColor()

ফোরগ্রাউন্ড কালার সেটিং পুনরুদ্ধার করে।

প্রত্যাবর্তন

String — অগ্রভাগের রঙ, সিএসএস স্বরলিপিতে ফর্ম্যাট করা (যেমন '#ffffff' ), অথবা যদি উপাদানটিতে এই বৈশিষ্ট্যের জন্য একাধিক মান থাকে তাহলে শূন্য

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getForegroundColor(offset)

নির্দিষ্ট অক্ষর অফসেটে অগ্রভাগের রঙ পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Sets the foreground color of the first 3 characters in the document body.
const text = body.editAsText().setForegroundColor(0, 2, '#0000FF');

// Gets the foreground color of the first character in the document body.
const foregroundColor = text.getForegroundColor(0);

// Logs the foreground color to the console.
console.log(foregroundcolor);

পরামিতি

নাম টাইপ বর্ণনা
offset Integer চরিত্র অফসেট.

প্রত্যাবর্তন

String — অগ্রভাগের রঙ, CSS স্বরলিপিতে বিন্যাসিত (যেমন '#ffffff' )।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getLinkUrl()

লিঙ্ক url পুনরুদ্ধার করে.

প্রত্যাবর্তন

String — লিঙ্ক url, বা নাল যদি উপাদানটিতে এই বৈশিষ্ট্যের জন্য একাধিক মান থাকে

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getLinkUrl(offset)

নির্দিষ্ট অক্ষর অফসেটে লিঙ্ক URL পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Applies a link to the first 10 characters in the body.
const text = body.editAsText().setLinkUrl(0, 9, 'https://www.example.com/');

// Gets the URL of the link from the first character.
const link = text.getLinkUrl(0);

// Logs the link URL to the console.
console.log(link);

পরামিতি

নাম টাইপ বর্ণনা
offset Integer চরিত্র অফসেট.

প্রত্যাবর্তন

String - লিঙ্ক URL।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

  • 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

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

getTextAlignment(offset)

একটি একক অক্ষরের জন্য পাঠ্য প্রান্তিককরণ পায়। সারিবদ্ধকরণের উপলব্ধ প্রকারগুলি হল DocumentApp.TextAlignment.NORMAL , DocumentApp.TextAlignment.SUBSCRIPT , এবং DocumentApp.TextAlignment.SUPERSCRIPT

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Sets the text alignment of the document body to NORMAL.
const text = body.editAsText().setTextAlignment(DocumentApp.TextAlignment.NORMAL);

// Gets the text alignment of the ninth character.
const alignment = text.getTextAlignment(8);

// Logs the text alignment to the console.
console.log(alignment.toString());

পরামিতি

নাম টাইপ বর্ণনা
offset Integer চরিত্রের অফসেট।

প্রত্যাবর্তন

TextAlignment — টেক্সট অ্যালাইনমেন্টের ধরন, অথবা যদি টেক্সট অ্যালাইনমেন্ট কখনও সেট করা না থাকে তাহলে null

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getTextAttributeIndices()

স্বতন্ত্র টেক্সট ফরম্যাটিং রানের শুরুর সাথে সঙ্গতিপূর্ণ টেক্সট সূচকের সেট পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Gets the text indices at which text formatting changes.
const indices = body.editAsText().getTextAttributeIndices();

// Logs the indices to the console.
console.log(indices.toString());

প্রত্যাবর্তন

Integer[] — পাঠ্য সূচকের সেট যেখানে পাঠ্য বিন্যাস পরিবর্তন হয়।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

  • 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

insertText(offset, text)

প্রদত্ত অক্ষর অফসেটে নির্দিষ্ট পাঠ্য সন্নিবেশ করান।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Inserts the text, 'Sample inserted text', at the start of the body content.
const text = body.editAsText().insertText(0, 'Sample inserted text');

পরামিতি

নাম টাইপ বর্ণনা
offset Integer অক্ষর অফসেট যেখানে পাঠ্য সন্নিবেশ করা হবে।
text String টেক্সট সন্নিবেশ করান.

প্রত্যাবর্তন

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

isBold()

সাহসী সেটিং পুনরুদ্ধার করে।

প্রত্যাবর্তন

Boolean — টেক্সটটি বোল্ড হোক বা শূন্য যদি এলিমেন্টে এই অ্যাট্রিবিউটের জন্য একাধিক মান থাকে

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

isBold(offset)

নির্দিষ্ট অক্ষর অফসেটে বোল্ড সেটিং পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Bolds the first 4 characters in the document body.
const text = body.editAsText().setBold(0, 3, true);

// Gets whether or not the text is bold.
const bold = text.editAsText().isBold(0);

// Logs the text's bold setting to the console
console.log(bold);

পরামিতি

নাম টাইপ বর্ণনা
offset Integer চরিত্র অফসেট.

প্রত্যাবর্তন

Boolean — সাহসী সেটিং।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

isItalic()

তির্যক সেটিং পুনরুদ্ধার করে।

প্রত্যাবর্তন

Boolean — টেক্সটটি তির্যক হোক বা শূন্য যদি উপাদানটিতে এই বৈশিষ্ট্যের জন্য একাধিক মান থাকে

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

isItalic(offset)

নির্দিষ্ট অক্ষর অফসেটে তির্যক সেটিং পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Sets the first 13 characters of the document body to italic.
const text = body.editAsText().setItalic(0, 12, true);

// Gets whether the fifth character in the document body is set to
// italic and logs it to the console.
const italic = text.isItalic(4);
console.log(italic);

পরামিতি

নাম টাইপ বর্ণনা
offset Integer চরিত্র অফসেট.

প্রত্যাবর্তন

Boolean — তির্যক সেটিং।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

isStrikethrough()

স্ট্রাইকথ্রু সেটিং পুনরুদ্ধার করে।

প্রত্যাবর্তন

Boolean — টেক্সট স্ট্রাইকথ্রু হোক বা শূন্য হোক যদি উপাদানটিতে এই অ্যাট্রিবিউটের একাধিক মান থাকে

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

isStrikethrough(offset)

নির্দিষ্ট অক্ষর অফসেটে স্ট্রাইকথ্রু সেটিং পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Sets the first 17 characters of the document body to strikethrough.
const text = body.editAsText().setStrikethrough(0, 16, true);

// Gets whether the first character in the document body is set to
// strikethrough and logs it to the console.
const strikethrough = text.isStrikethrough(0);
console.log(strikethrough);

পরামিতি

নাম টাইপ বর্ণনা
offset Integer চরিত্র অফসেট.

প্রত্যাবর্তন

Boolean — স্ট্রাইকথ্রু সেটিং।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

isUnderline()

আন্ডারলাইন সেটিং পুনরুদ্ধার করে।

প্রত্যাবর্তন

Boolean — টেক্সট আন্ডারলাইন করা হোক বা শূন্য যদি এলিমেন্টে এই অ্যাট্রিবিউটের জন্য একাধিক মান থাকে

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

isUnderline(offset)

নির্দিষ্ট অক্ষর অফসেটে আন্ডারলাইন সেটিং পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Sets the first 13 characters of the document body to underline.
const text = body.editAsText().setUnderline(0, 12, false);

// Gets whether the first character in the document body is set to
// underline and logs it to the console
const underline = text.editAsText().isUnderline(0);
console.log(underline);

পরামিতি

নাম টাইপ বর্ণনা
offset Integer চরিত্র অফসেট.

প্রত্যাবর্তন

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

প্রত্যাবর্তন

Text - একত্রিত উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

প্রত্যাবর্তন

Text - সরানো উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

replaceText(searchPattern, replacement)

রেগুলার এক্সপ্রেশন ব্যবহার করে একটি প্রদত্ত টেক্সট প্যাটার্নের সমস্ত ঘটনাকে একটি প্রদত্ত প্রতিস্থাপন স্ট্রিং দিয়ে প্রতিস্থাপন করে।

অনুসন্ধান প্যাটার্নটি একটি স্ট্রিং হিসাবে পাস করা হয়, একটি জাভাস্ক্রিপ্ট রেগুলার এক্সপ্রেশন অবজেক্ট নয়। এর কারণে আপনাকে প্যাটার্নে যেকোনো ব্যাকস্ল্যাশ এড়াতে হবে।

এই পদ্ধতিগুলি Google এর RE2 রেগুলার এক্সপ্রেশন লাইব্রেরি ব্যবহার করে, যা সমর্থিত সিনট্যাক্সকে সীমাবদ্ধ করে।

প্রদত্ত রেগুলার এক্সপ্রেশন প্যাটার্নটি বর্তমান উপাদানে থাকা প্রতিটি টেক্সট ব্লকের সাথে স্বাধীনভাবে মিলে যায়।

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

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

পরামিতি

নাম টাইপ বর্ণনা
searchPattern String অনুসন্ধান করার জন্য regex প্যাটার্ন
replacement String প্রতিস্থাপন হিসাবে ব্যবহার করার জন্য পাঠ্য

প্রত্যাবর্তন

Element - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setAttributes(startOffset, endOffsetInclusive, attributes)

প্রদত্ত অক্ষর পরিসরে নির্দিষ্ট বৈশিষ্ট্যগুলি প্রয়োগ করে।

নির্দিষ্ট বৈশিষ্ট্যের প্যারামিটারটি অবশ্যই এমন একটি বস্তু হতে হবে যেখানে প্রতিটি সম্পত্তির নাম DocumentApp.Attribute গণনার একটি আইটেম এবং প্রতিটি সম্পত্তির মান প্রয়োগ করা নতুন মান।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body and edits as text.
const body = doc.getBody().editAsText();

// Declares style attributes for font size and font family.
const style = {}
style[DocumentApp.Attribute.FONT_SIZE] = 20 ;
style[DocumentApp.Attribute.FONT_FAMILY] = 'Impact';

// Sets the style attributes to the first 9 characters in the document body.
const text = body.setAttributes(0, 8, style);

পরামিতি

নাম টাইপ বর্ণনা
startOffset Integer টেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusive Integer পাঠ্য পরিসরের শেষ অফসেট।
attributes Object উপাদান এর বৈশিষ্ট্য.

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

পরামিতি

নাম টাইপ বর্ণনা
attributes Object উপাদান এর বৈশিষ্ট্য.

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setBackgroundColor(startOffset, endOffsetInclusive, color)

নির্দিষ্ট অক্ষর পরিসরের জন্য পটভূমির রঙ সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Sets the background color of the first 3 characters in the
// document body to hex color #0000FF.
const text = body.editAsText().setBackgroundColor(0, 2, '#0000FF');

পরামিতি

নাম টাইপ বর্ণনা
startOffset Integer টেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusive Integer পাঠ্য পরিসরের শেষ অফসেট।
color String পটভূমির রঙ, CSS স্বরলিপিতে বিন্যাসিত (যেমন '#ffffff' )।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setBackgroundColor(color)

পটভূমির রঙ সেট করে।

পরামিতি

নাম টাইপ বর্ণনা
color String পটভূমির রঙ, CSS স্বরলিপিতে বিন্যাসিত (যেমন '#ffffff' )

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setBold(bold)

বোল্ড সেটিং সেট করে।

পরামিতি

নাম টাইপ বর্ণনা
bold Boolean সাহসী সেটিং

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setBold(startOffset, endOffsetInclusive, bold)

নির্দিষ্ট অক্ষর পরিসরের জন্য বোল্ড সেটিং সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Sets the first 11 characters in the document body to bold.
const text = body.editAsText().setBold(0, 10, true);

পরামিতি

নাম টাইপ বর্ণনা
startOffset Integer টেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusive Integer পাঠ্য পরিসরের শেষ অফসেট।
bold Boolean সাহসী সেটিং।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setFontFamily(startOffset, endOffsetInclusive, fontFamilyName)

নির্দিষ্ট অক্ষর পরিসরের জন্য ফন্ট পরিবার সেট করে। নামটি ডক্স বা Google ফন্টের ফন্ট মেনু থেকে যেকোনো ফন্ট হতে পারে এবং এটি কেস-সংবেদনশীল। অচেনা ফন্টের নাম Arial হিসেবে রেন্ডার হবে। getFontFamily(offset) এবং setFontFamily(fontFamilyName) পদ্ধতিগুলি এখন FontFamily enum-এর পরিবর্তে ফন্টগুলির জন্য স্ট্রিং নাম ব্যবহার করে। যদিও এই enumটি অবমূল্যায়িত করা হয়েছে, এটি পুরানো স্ক্রিপ্টগুলির সাথে সামঞ্জস্যের জন্য উপলব্ধ থাকবে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets body of the document.
const body = doc.getBody();

// Sets the font of the first 4 characters in the document body to Roboto.
const text = body.editAsText().setFontFamily(0, 3, 'Roboto');

পরামিতি

নাম টাইপ বর্ণনা
startOffset Integer টেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusive Integer পাঠ্য পরিসরের শেষ অফসেট।
fontFamilyName String ডক্স বা Google ফন্টের ফন্ট মেনু থেকে ফন্ট পরিবারের নাম।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setFontFamily(fontFamilyName)

ফন্ট পরিবার সেট করে। নামটি ডক্স বা Google ফন্টের ফন্ট মেনু থেকে যেকোনো ফন্ট হতে পারে এবং এটি কেস-সংবেদনশীল। অচেনা ফন্টের নাম Arial হিসেবে রেন্ডার হবে। getFontFamily() এবং setFontFamily(fontFamilyName) পদ্ধতিগুলি এখন FontFamily enum-এর পরিবর্তে ফন্টের জন্য স্ট্রিং নাম ব্যবহার করে। যদিও এই enumটি অবমূল্যায়িত করা হয়েছে, এটি পুরানো স্ক্রিপ্টগুলির সাথে সামঞ্জস্যের জন্য উপলব্ধ থাকবে।

পরামিতি

নাম টাইপ বর্ণনা
fontFamilyName String ডক্স বা Google ফন্টের ফন্ট মেনু থেকে ফন্ট পরিবারের নাম

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setFontSize(startOffset, endOffsetInclusive, size)

নির্দিষ্ট অক্ষর পরিসরের জন্য ফন্টের আকার সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Sets the size of the first 11 characters in the document body to 12.
const text = body.editAsText().setFontSize(0, 10, 12);

পরামিতি

নাম টাইপ বর্ণনা
startOffset Integer টেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusive Integer পাঠ্য পরিসরের শেষ অফসেট।
size Number ফন্টের আকার।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setFontSize(size)

ফন্ট সাইজ সেট করে।

পরামিতি

নাম টাইপ বর্ণনা
size Number ফন্টের আকার

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setForegroundColor(startOffset, endOffsetInclusive, color)

নির্দিষ্ট অক্ষর পরিসরের জন্য অগ্রভাগের রঙ সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Sets the foreground color of the first 2 characters in the
// document body to hex color #FF0000.
const text = body.editAsText().setForegroundColor(0, 1, '#FF0000');

// Gets the foreground color for the second character in the document body.
const foregroundColor = text.getForegroundColor(1);

//  Logs the foreground color to the console.
console.log(foregroundColor);

পরামিতি

নাম টাইপ বর্ণনা
startOffset Integer টেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusive Integer পাঠ্য পরিসরের শেষ অফসেট।
color String অগ্রভাগের রঙ, CSS স্বরলিপিতে বিন্যাসিত (যেমন '#ffffff' )।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setForegroundColor(color)

অগ্রভাগের রঙ সেট করে।

পরামিতি

নাম টাইপ বর্ণনা
color String অগ্রভাগের রঙ, CSS স্বরলিপিতে বিন্যাসিত (যেমন '#ffffff' )

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setItalic(italic)

তির্যক সেটিং সেট করে।

পরামিতি

নাম টাইপ বর্ণনা
italic Boolean তির্যক সেটিং

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setItalic(startOffset, endOffsetInclusive, italic)

নির্দিষ্ট অক্ষর পরিসরের জন্য তির্যক সেটিং সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Sets the first 11 characters in the document body to italic.
const text = body.editAsText().setItalic(0, 10, true);

পরামিতি

নাম টাইপ বর্ণনা
startOffset Integer টেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusive Integer পাঠ্য পরিসরের শেষ অফসেট।
italic Boolean তির্যক সেটিং।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setLinkUrl(startOffset, endOffsetInclusive, url)

নির্দিষ্ট অক্ষর পরিসরের জন্য লিঙ্ক URL সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Applies a link to the first 11 characters in the body.
const text = body.editAsText().setLinkUrl(0, 10, 'https://example.com');

পরামিতি

নাম টাইপ বর্ণনা
startOffset Integer টেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusive Integer পাঠ্য পরিসরের শেষ অফসেট।
url String লিঙ্ক URL.

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setLinkUrl(url)

লিঙ্ক url সেট করে।

পরামিতি

নাম টাইপ বর্ণনা
url String লিঙ্ক url

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setStrikethrough(strikethrough)

স্ট্রাইকথ্রু সেটিং সেট করে।

পরামিতি

নাম টাইপ বর্ণনা
strikethrough Boolean স্ট্রাইকথ্রু সেটিং

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setStrikethrough(startOffset, endOffsetInclusive, strikethrough)

নির্দিষ্ট অক্ষর পরিসরের জন্য স্ট্রাইকথ্রু সেটিং সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Sets the first 11 characters in the document body to strikethrough.
const text = body.editAsText().setStrikethrough(0, 10, true);

পরামিতি

নাম টাইপ বর্ণনা
startOffset Integer টেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusive Integer পাঠ্য পরিসরের শেষ অফসেট।
strikethrough Boolean স্ট্রাইকথ্রু সেটিং।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setText(text)

পাঠ্য বিষয়বস্তু সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Replaces the contents of the body with the text, 'New body text.'
const text = body.editAsText().setText('New body text.');

পরামিতি

নাম টাইপ বর্ণনা
text String নতুন পাঠ্য বিষয়বস্তু.

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setTextAlignment(startOffset, endOffsetInclusive, textAlignment)

একটি প্রদত্ত অক্ষর পরিসরের জন্য পাঠ্য সারিবদ্ধকরণ সেট করে। সারিবদ্ধকরণের উপলব্ধ প্রকারগুলি হল DocumentApp.TextAlignment.NORMAL , DocumentApp.TextAlignment.SUBSCRIPT , এবং DocumentApp.TextAlignment.SUPERSCRIPT

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

পরামিতি

নাম টাইপ বর্ণনা
startOffset Integer অক্ষর পরিসরের শুরু অফসেট।
endOffsetInclusive Integer অক্ষর পরিসরের শেষ অফসেট (অন্তর্ভুক্ত)।
textAlignment TextAlignment প্রযোজ্য পাঠ্য প্রান্তিককরণের ধরন।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

পরামিতি

নাম টাইপ বর্ণনা
textAlignment TextAlignment প্রযোজ্য পাঠ্য প্রান্তিককরণের ধরন

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setUnderline(underline)

আন্ডারলাইন সেটিং সেট করে।

পরামিতি

নাম টাইপ বর্ণনা
underline Boolean আন্ডারলাইন সেটিং

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setUnderline(startOffset, endOffsetInclusive, underline)

নির্দিষ্ট অক্ষর পরিসরের জন্য আন্ডারলাইন সেটিং সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/abc123456/edit');

// Gets the document body.
const body = doc.getBody();

// Sets the first 11 characters in the document body to underline.
const text = body.editAsText().setUnderline(0, 10, true);

পরামিতি

নাম টাইপ বর্ণনা
startOffset Integer টেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusive Integer পাঠ্য পরিসরের শেষ অফসেট।
underline Boolean আন্ডারলাইন সেটিং।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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