Interface BlobSource
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
منبع لکه رابط برای اشیایی که می توانند داده های خود را به صورت Blob
صادر کنند.
اجرای کلاس ها
نام | شرح مختصر |
---|
Blob | یک شی تبادل داده برای سرویس های Apps Script. |
Chart | یک شی نمودار، که می تواند به یک تصویر ثابت تبدیل شود. |
Document | یک سند، حاوی یک یا چند شی Tab ، که هر کدام حاوی متن غنی و عناصری مانند جداول و لیست است. |
Embedded Chart | نموداری را نشان می دهد که در یک صفحه گسترده جاسازی شده است. |
File | یک فایل در گوگل درایو. |
Gmail Attachment | پیوستی از جیمیل. |
HTTPResponse | این کلاس به کاربران اجازه می دهد تا به اطلاعات خاصی در مورد پاسخ های HTTP دسترسی داشته باشند. |
Html Output | یک شی Html Output که می تواند از یک اسکریپت ارائه شود. |
Image | یک Page Element که یک تصویر را نشان می دهد. |
Inline Image | عنصری که یک تصویر جاسازی شده را نشان می دهد. |
Jdbc Blob | یک Blob JDBC. |
Jdbc Clob | Clob JDBC. |
Picture Fill | پرکنندهای که تصویری را بهاندازهی ظرفش کشیده است. |
Positioned Image | تصویر موقعیت ثابت لنگر به یک Paragraph . |
Spreadsheet | به فایلهای Google Sheets دسترسی داشته باشید و آنها را تغییر دهید. |
Static Map | امکان ایجاد و تزئین تصاویر نقشه ایستا را فراهم می کند. |
روش ها
روش | نوع برگشت | شرح مختصر |
---|
get As(contentType) | Blob | داده های داخل این شی را به عنوان یک حباب تبدیل به نوع محتوای مشخص شده برگردانید. |
get Blob() | Blob | داده های داخل این شی را به صورت حباب برگردانید. |
مستندات دقیق
get As(contentType)
داده های داخل این شی را به عنوان یک حباب تبدیل به نوع محتوای مشخص شده برگردانید. این روش پسوند مناسب را به نام فایل اضافه می کند - به عنوان مثال، "myfile.pdf". با این حال، فرض میکند که بخشی از نام فایل که پس از آخرین نقطه (در صورت وجود) یک پسوند موجود است که باید جایگزین شود. در نتیجه، "ShoppingList.12.25.2014" به "ShoppingList.12.25.pdf" تبدیل می شود.
برای مشاهده سهمیه های روزانه برای تبدیل، به سهمیه خدمات Google مراجعه کنید. دامنههای جدید Google Workspace ممکن است به طور موقت مشمول سهمیههای سختگیرانهتر شوند.
پارامترها
نام | تایپ کنید | توضیحات |
---|
content Type | String | نوع MIME برای تبدیل. برای اکثر حبابها، 'application/pdf' تنها گزینه معتبر است. برای تصاویر با فرمت BMP، GIF، JPEG یا PNG، هر یک از 'image/bmp' ، 'image/gif' ، 'image/jpeg' یا 'image/png' نیز معتبر هستند. برای سند Google Docs، 'text/markdown' نیز معتبر است. |
بازگشت
Blob
- داده ها به عنوان یک لکه.
get Blob()
داده های داخل این شی را به صورت حباب برگردانید.
بازگشت
Blob
- داده ها به عنوان یک لکه.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003e\u003ccode\u003eBlobSource\u003c/code\u003e is an interface allowing objects to export their data as a Blob.\u003c/p\u003e\n"],["\u003cp\u003eIt offers two primary methods: \u003ccode\u003egetAs()\u003c/code\u003e to retrieve data as a Blob with a specific content type and \u003ccode\u003egetBlob()\u003c/code\u003e for getting data as a raw Blob.\u003c/p\u003e\n"],["\u003cp\u003eVarious Apps Script objects, including Documents, Spreadsheets, and Images, implement this interface.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetAs()\u003c/code\u003e can convert data to formats like PDF, common image types, and Markdown for Google Docs, but is subject to usage quotas.\u003c/p\u003e\n"]]],[],null,["# Interface BlobSource\n\nBlobSource\n\nInterface for objects that can export their data as a [Blob](/apps-script/reference/base/blob).\n\n### Implementing classes\n\n| Name | Brief description |\n|------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Blob](/apps-script/reference/base/blob) | A data interchange object for Apps Script services. |\n| [Chart](../charts/chart.html) | A Chart object, which can be converted to a static image. |\n| [Document](../document/document.html) | A document, containing one or more [Tab](../document/tab.html) objects, each of which contains rich text and elements such as tables and lists. |\n| [EmbeddedChart](../spreadsheet/embedded-chart.html) | Represents a chart that has been embedded into a spreadsheet. |\n| [File](../drive/file.html) | A file in Google Drive. |\n| [GmailAttachment](../gmail/gmail-attachment.html) | An attachment from Gmail. |\n| [HTTPResponse](../url-fetch/http-response.html) | This class allows users to access specific information on HTTP responses. |\n| [HtmlOutput](../html/html-output.html) | An `Html``Output` object that can be served from a script. |\n| [Image](../slides/image.html) | A [PageElement](../slides/page-element.html) representing an image. |\n| [InlineImage](../document/inline-image.html) | An element representing an embedded image. |\n| [JdbcBlob](../jdbc/jdbc-blob.html) | A JDBC `Blob`. |\n| [JdbcClob](../jdbc/jdbc-clob.html) | A JDBC `Clob`. |\n| [PictureFill](../slides/picture-fill.html) | A fill that renders an image that's stretched to the dimensions of its container. |\n| [PositionedImage](../document/positioned-image.html) | Fixed position image anchored to a [Paragraph](../document/paragraph.html). |\n| [Spreadsheet](../spreadsheet/spreadsheet.html) | Access and modify Google Sheets files. |\n| [StaticMap](../maps/static-map.html) | Allows for the creation and decoration of static map images. |\n\n### Methods\n\n| Method | Return type | Brief description |\n|--------------------------------------|------------------------------------------|---------------------------------------------------------------------------------------|\n| [getAs(contentType)](#getAs(String)) | [Blob](/apps-script/reference/base/blob) | Return the data inside this object as a blob converted to the specified content type. |\n| [getBlob()](#getBlob()) | [Blob](/apps-script/reference/base/blob) | Return the data inside this object as a blob. |\n\nDetailed documentation\n----------------------\n\n### `get``As(contentType)`\n\nReturn the data inside this object as a blob converted to the specified content type. This\nmethod adds the appropriate extension to the filename---for example, \"myfile.pdf\". However, it\nassumes that the part of the filename that follows the last period (if any) is an existing\nextension that should be replaced. Consequently, \"ShoppingList.12.25.2014\" becomes\n\"ShoppingList.12.25.pdf\".\n\nTo view the daily quotas for conversions, see [Quotas for Google\nServices](https://developers.google.com/apps-script/guides/services/quotas). Newly created Google Workspace domains might be temporarily subject to stricter\nquotas.\n\n#### Parameters\n\n| Name | Type | Description |\n|-----------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `content``Type` | `String` | The MIME type to convert to. For most blobs, `'application/pdf'` is the only valid option. For images in BMP, GIF, JPEG, or PNG format, any of `'image/bmp'`, `'image/gif'`, `'image/jpeg'`, or `'image/png'` are also valid. For a Google Docs document, `'text/markdown'` is also valid. |\n\n#### Return\n\n\n[Blob](/apps-script/reference/base/blob) --- The data as a blob.\n\n*** ** * ** ***\n\n### `get``Blob()`\n\nReturn the data inside this object as a blob.\n\n#### Return\n\n\n[Blob](/apps-script/reference/base/blob) --- The data as a blob."]]