Paste Image and convert to text

SyntaxEditor for Windows Forms Forum

Posted 7 years ago by Steven Ashley
Version: 16.1.0330

With the Html Syntax Editor I am trying to add functionality to allow pasting of an image, and then convert the pasted image into an embedded Html image onto the page, however the PasteDragDrop event doesn't fire in order to perform the conversion.

I am guessing that I am missing some location where to set the CanPaste property, but I cannot find it.

Any suggestions would be appreciated.

Comments (1)

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Steven,

The problem here is that our paste logic in PasteFromClipboardCommand won't execute if the clipboard object doesn't have either Text or UnicodeText format data included in the data object.

What you could possibly do is remove the Ctrl+V and Shift+Insert command links for PasteFromClipboardCommand in the SyntaxEditor.CommandLinks collection.  Then make your own class that inherits PasteFromClipboardCommand and override its Execute method.  Put your logic in there to coerce things and make some form of Text entry in the Clipboard's data object if appropriate.  Then run our base logic and that should insert the text when executed.  Finally, make sure you add new command links for those shortcut keys with instances of your new inherited class.

Actipro Software Support

The latest build of this product (v24.1.0) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.