We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Auto-size of RTE image during upload

Thread ID:





124967 Jul 11,2016 04:55 PM UTC Jul 19,2016 03:10 PM UTC JavaScript 3
Tags: ejRTE
Randy Craven
Asked On July 11, 2016 04:55 PM UTC


When uploading an image to the RTE, I would like to set the width and height of the image, so that the entire image will be visible within the dimensions of the RTE .  I would prefer to do this programatically and not allow the user to set the dimensions.

Can anyone suggest a way to do this?

Randy Craven

Dhivyalakshmi Thirumurugan [Syncfusion]
Replied On July 12, 2016 05:20 AM UTC

Hi Randy,   
Thanks for contacting Syncfusion support.   
We can resize the image by setting the height and width in the image dialog. For this we need to set the showDimensions property as trueand by default, the Constrain Proportion checkbox is selected to resize an image to an exact proportion. To apply the exact width and height that you specify into the Height and Width textboxes, uncheck the Constrain Proportions checkbox.  
Please find the code below.  
                toolsList: ["images"],   
                tools: { images: ["image"] },   
                width: "100%",   
                minWidth: "150px",   
                showDimensions: true,   
                imageBrowser: { filePath: "http://mvc.syncfusion.com/OdataServices/FileBrowser/", ajaxAction: fileService, extensionAllow: "*.png, *.gif, *.jpg, *.jpeg, *.docx", ajaxSettings: ajaxSettings },   
                fileBrowser: { filePath: "http://mvc.syncfusion.com/OdataServices/FileBrowser/", ajaxAction: fileService, extensionAllow: "*.txt, *.png, *.pdf,*.jpeg", ajaxSettings: ajaxSettings1           }   

We have prepared the sample as per your requirement and please find the sample below.  
Other References:  
Please let us know if you need any further assistance.   

Randy Craven
Replied On July 18, 2016 11:13 PM UTC

Hello Dhivyalakshmi,

Thank you for this information.

Is there a way to size the image without asking the user to enter anything?  For example: by determining the dimensions of the uploaded image and also the RTE 'viewport' and programmatically sizing the image to fit.

Can that be done?

Thank you again,

Keerthana Rajendran [Syncfusion]
Replied On July 19, 2016 03:10 PM UTC

Hi Randy, 
Thank you for contacting Syncfusion support.  
We have prepared a sample based on our understanding by setting default height and width for images inserted into RTE in change event of RTE 
function onchange() 
We have prepared a sample for your reference. Please refer the below given link: 
If this doesn't match your requirement please get back to us with some more clear details on your query  


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon