Insert image from extension into document
Purpose
To insert the image from extension into the current writer document.
Syntax
WriterClient.dispatch("insertImage", <image_data_variable>).then(function(response){console.log(response)});
Data Parameters
Parameter | Data Type | Description |
Mandatory Parameters | ||
src | String | Specify the url of the image that needs to be inserted. |
height | Integer | Specify the height of the image to be inserted. |
width | Integer | Specify the width of the image to be inserted. |
Sample data with HTML
Copiedlet data = {
"src": "https://images.pexels.com/photos/18340828/pexels-photo-18340828/free-photo-of-man-in-traditional-north-american-indigenous-clothing.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
"height": 1800,
"width": 1600
};
WriterClient.dispatch("insertImage", data).then(function(response){console.log(response)});
Sample Response
Copied{
"message": "Object Fetched ",
"data": {
"content": {
"data": {
"result": 1,
"response": [
{
height: 1800,
id: "88522831",
src: "https://writer.zoho.com/writer/image.do?imgurl=r-c0hk44e4268dc22474caeacbc065c22385eae-49e39dab4ad14650ba95cc58989560ebef9iax10vfsh&rid=c0hk44e4268dc22474caeacbc065c22385eae",
width: 1600
}
]
}
}
}
}