Question

Paste Image and convert to text

Posted 1 year ago by Avatar Steven Ashley

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 1 year 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
Information The latest build of this product (2018.1 build 0340) was released 1 days ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.