I have used this Kendo editor but when i try to copy image with text , only text get copied not images. Please someone can help me on this.
Thank you
I have used this Kendo editor but when i try to copy image with text , only text get copied not images. Please someone can help me on this.
Thank you
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jayraj ChhayaRank #304 · 8.2K reputationPosted Mar 11, 2024, 3:15 AM EDT
When copying content from the Kendo Editor, images are not directly copied as part of the text selection. To enable copying images along with text, you would need to handle this functionality separately. One approach is to convert the image to a data URL and then insert it into the copied text as an inline image. Here's a basic example using JavaScript to achieve this:
// Get the image source var imgSrc = document.querySelector('.k-image img').src; // Convert the image to a data URL var canvas = document.createElement('canvas'); var ctx = canvas.getContext('2d'); var img = new Image(); img.crossOrigin = 'Anonymous'; img.onload = function() { canvas.width = img.width; canvas.height = img.height; ctx.drawImage(img, 0, 0); var dataURL = canvas.toDataURL(); // Insert the data URL into the copied text document.execCommand('copy'); }; img.src = imgSrc;By implementing this approach, you can enhance the copy functionality of the Kendo Editor to include images along with text.
Soma Debnath7 reputationPosted Mar 11, 2024, 3:25 AM EDT
I am trying to copy text along with images from word file to Kendo editor but not working .. Thank you