Hello reinmar and Friends
Your help is appreciated if possible. I am trying to retrieve the clipboard data using the following snipped during the paste ( CNTRL + V) on editor.
- I am working on IE 9 and I need the clipboard data as such without default filtering on the microsoft word HTML.
- I have some logic to convert the styles , say for example conversion of style mso-highlight to background-color etc.,
- I have logic to change the microsoft imageData src="fill:///C:\...jpg " tag to regular image tags "img" and process the src data into base64 data and store it db and generate the url's
If I use the evt.data.dataValue (i.e., dataValue on the event ) , I get the clipboard data that is filtered and processed by CKeditor ( i.e., the cleaned data , the imageData tag are cleaned up during those cleaning ,the mso-highlight and other styles are cleaned up on which I should do transformation to regular styles and build the img tags from imageData tag of microsoft word html.
But If I use the getClipboardData I am able to retrieve the exact clipboard content (i.e,. microsoft word html content). During paste event I called the editor.getClipboardData recursively until I get the data but my browser was hung not sure how to retrieve the same and achieve my objectives , you help is appreciated.
So the problem is I tried with the sample code as shown below on the following events , beforepaste, pastestate,paste as soon as CNTRL+V is clicked for none of the above events I am able to retreive the clipboardData , I am able to retrieve the clipboard data when the afterpaste is triggered but by then the copied data is already displayed in the CKeditor.
I want to avoid the paste of the copied data into the CKEditor , on cntrl+v , I wish to retreive the clipboard data using afterPaste event and process the clipboard data as mentioend above and then invoke the build in filtering mechanism of the CKeditor to clean the html provided cleaning is required before using inserthrml() and then finally insert html into the CKEditor using inserthtml() ;
var clipboardData = null;
editor.on('paste', function(evt) {editor.getClipboardData( { title: 'Get my data' }, function( data ) { if ( data ) clipboardData = data.dataValue ; } ); });