ইনলাইন ইমেজ ঢোকান, ইনলাইন ইমেজ ঢোকান
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
আপনি InsertInlineImageRequest
পদ্ধতি ব্যবহার করে একটি নথিতে একটি চিত্র সন্নিবেশ করতে পারেন। আপনি ঐচ্ছিকভাবে ইমেজ রিসাইজ করতে objectSize
ক্ষেত্র ব্যবহার করতে পারেন।
আপনি এই পদ্ধতিতে যে URLটি প্রদান করেন তার মাধ্যমে ছবিটি অবশ্যই সর্বজনীনভাবে অ্যাক্সেসযোগ্য হতে হবে। জাভা
List<Request> requests = new ArrayList <>();
requests . add ( new Request (). setInsertInlineImage ( new InsertInlineImageRequest ()
. setUri ( "https://fonts.gstatic.com/s/i/productlogos/docs_2020q4/v6/web-64dp/logo_docs_2020q4_color_1x_web_64dp.png" )
. setLocation ( new Location (). setIndex ( 1 ). setTabId ( TAB_ID ))
. setObjectSize ( new Size ()
. setHeight ( new Dimension ()
. setMagnitude ( 50.0 )
. setUnit ( "PT" ))
. setWidth ( new Dimension ()
. setMagnitude ( 50.0 )
. setUnit ( "PT" )))));
BatchUpdateDocumentRequest body = new BatchUpdateDocumentRequest (). setRequests ( requests );
BatchUpdateDocumentResponse response = docsService . documents ()
. batchUpdate ( DOCUMENT_ID , body ). execute (); পিএইচপি
$requests = array();
$requests[] = new Google_Service_Docs_Request(array(
'insertInlineImage' => array(
'uri' => 'https://fonts.gstatic.com/s/i/productlogos/docs_2020q4/v6/web-64dp/logo_docs_2020q4_color_1x_web_64dp.png',
'location' => array(
'index' => 1,
'tabId' => TAB_ID,
),
'objectSize' => array(
'height' => array(
'magnitude' => 50,
'unit' => 'PT',
),
'width' => array(
'magnitude' => 50,
'unit' => 'PT',
),
)
)
));
// Execute the requests.
$batchUpdateRequest = new Google_Service_Docs_BatchUpdateDocumentRequest(array(
'requests' => $requests
));
$response =
$docsService->documents->batchUpdate(DOCUMENT_ID, $batchUpdateRequest); পাইথন
requests = [{
'insertInlineImage' : {
'location' : {
'index' : 1 ,
'tabId' : TAB_ID
},
'uri' :
'https://fonts.gstatic.com/s/i/productlogos/docs_2020q4/v6/web-64dp/logo_docs_2020q4_color_1x_web_64dp.png' ,
'objectSize' : {
'height' : {
'magnitude' : 50 ,
'unit' : 'PT'
},
'width' : {
'magnitude' : 50 ,
'unit' : 'PT'
}
}
}
}]
# Execute the request.
body = { 'requests' : requests }
response = service . documents () . batchUpdate (
documentId = document_id , body = body ) . execute ()
insert_inline_image_response = response . get ( 'replies' )[ 0 ] . get (
'insertInlineImage' )
print ( 'Inserted image with object ID: {0} ' . format (
insert_inline_image_response . get ( 'objectId' ))) পদ্ধতিটি দৈর্ঘ্য 1 এর একটি InlineObjectElement
সহ একটি নতুন ParagraphElement
হিসাবে চিত্রটিকে সন্নিবেশ করায়, যেখানে startIndex
হল অনুরোধের অবস্থান।
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License -এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License -এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# Insert inline images\n\nYou can insert an image into a document using the\n[`InsertInlineImageRequest`](/workspace/docs/api/reference/rest/v1/documents/request#insertinlineimagerequest)\nmethod. You can optionally use the `objectSize` field to resize the image.\nThe image must be publicly accessible through the URL that you provide in this method. \n\n### Java\n\n```java\nList\u003cRequest\u003e requests = new ArrayList\u003c\u003e();\nrequests.add(new Request().setInsertInlineImage(new InsertInlineImageRequest()\n .setUri(\"https://fonts.gstatic.com/s/i/productlogos/docs_2020q4/v6/web-64dp/logo_docs_2020q4_color_1x_web_64dp.png\")\n .setLocation(new Location().setIndex(1).setTabId(TAB_ID))\n .setObjectSize(new Size()\n .setHeight(new Dimension()\n .setMagnitude(50.0)\n .setUnit(\"PT\"))\n .setWidth(new Dimension()\n .setMagnitude(50.0)\n .setUnit(\"PT\")))));\n\nBatchUpdateDocumentRequest body = new BatchUpdateDocumentRequest().setRequests(requests);\nBatchUpdateDocumentResponse response = docsService.documents()\n .batchUpdate(DOCUMENT_ID, body).execute();\n```\n\n### PHP\n\n```php\n$requests = array();\n$requests[] = new Google_Service_Docs_Request(array(\n 'insertInlineImage' =\u003e array(\n 'uri' =\u003e 'https://fonts.gstatic.com/s/i/productlogos/docs_2020q4/v6/web-64dp/logo_docs_2020q4_color_1x_web_64dp.png',\n 'location' =\u003e array(\n 'index' =\u003e 1,\n 'tabId' =\u003e TAB_ID,\n ),\n 'objectSize' =\u003e array(\n 'height' =\u003e array(\n 'magnitude' =\u003e 50,\n 'unit' =\u003e 'PT',\n ),\n 'width' =\u003e array(\n 'magnitude' =\u003e 50,\n 'unit' =\u003e 'PT',\n ),\n )\n )\n));\n\n// Execute the requests.\n$batchUpdateRequest = new Google_Service_Docs_BatchUpdateDocumentRequest(array(\n 'requests' =\u003e $requests\n));\n$response =\n $docsService-\u003edocuments-\u003ebatchUpdate(DOCUMENT_ID, $batchUpdateRequest);\n```\n\n### Python\n\n```python\nrequests = [{\n 'insertInlineImage': {\n 'location': {\n 'index': 1,\n 'tabId': TAB_ID\n },\n 'uri':\n 'https://fonts.gstatic.com/s/i/productlogos/docs_2020q4/v6/web-64dp/logo_docs_2020q4_color_1x_web_64dp.png',\n 'objectSize': {\n 'height': {\n 'magnitude': 50,\n 'unit': 'PT'\n },\n 'width': {\n 'magnitude': 50,\n 'unit': 'PT'\n }\n }\n }\n}]\n\n# Execute the request.\nbody = {'requests': requests}\nresponse = service.documents().batchUpdate(\n documentId=document_id, body=body).execute()\ninsert_inline_image_response = response.get('replies')[0].get(\n 'insertInlineImage')\nprint('Inserted image with object ID: {0}'.format(\n insert_inline_image_response.get('objectId')))\n```\n\nThe method inserts the image as a new\n[`ParagraphElement`](/workspace/docs/api/reference/rest/v1/documents#paragraphelement)\nwith an\n[`InlineObjectElement`](/workspace/docs/api/reference/rest/v1/documents#InlineObjectElement)\nof length 1, where the `startIndex` is the request's location."]]