I am using the Kendo UI Editor widget. I want to paste the content of the print screen. How can I do that?
Regards,
Naidu
Here is a related question. Seems to work in latest Chrome and Firefox. And can be plugged in the Kendo Editor via some code:
var editor = $("#editor").data("kendoEditor");
$(editor.document).on("paste", function(e) {
  var clipboard = e.originalEvent.clipboardData;
  if (clipboard && clipboard.items) {
      var screenshot = clipboard.items[0];
      if (screenshot.kind == "file") {
          var blob = screenshot.getAsFile();
          var reader = new FileReader();
          reader.onload = function(event){
            var html = kendo.format('<img src="{0}"/>', event.target.result);
            editor.paste(html);
          };
          reader.readAsDataURL(blob);
      }
  }
});
And here is a live demo: http://jsbin.com/utapal/1/edit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With