Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
55
Pasting a word document into WebHtmlEditor takes a really long time
posted

I can open a word document, then select all, copy, and paste into WebHtmlEditor.  The good news:  it does what you'd want - i.e., you get the WordHtml version your document, with much the same formatting.  But the bad news: it seems to take *virtually forever* to render within the HTMLeditor.  Like, minutes for a one-page word document.

I realize the Word's version of html is a little strange, that it has a lot of extra stuff, etc.  But geez, is it really that complicated?  BTW, MSIE manages to render the same HTML with little ado.

 Any ideas?

-Scott

Parents
No Data
Reply
  • 3521
    posted

    In my opinion, you are treading down a trecherous path allowing folks to paste in anything from Word or Excel into an IG WebHtmlEditor. 

     I have spent many hours talking to support and other folks about these same kind of problems.  I had problems with folks pasting in Excel spreadsheets and everything else.  Morons.

     I finally have taken steps to remove all HTML formatting on pasting into IG WebHtmlEditors....

    Here is a code snippet to achieve this goal:

    // Following block of code is here to prevent pasting of HTML into the

    // IG RTB's. iged_strip is an internal routine used by IG to strip HTML from

    // textboxes. It is being accessed here at the risk of IG changing their CSOM

    // in the future.

    var oEditor = iged_getById('WebHtmlEditor1');

    oEditor._addLsnr(oEditor._elem, "beforepaste", myPreventPaste)

    oEditor._addLsnr(oEditor._elem, "paste", myPaste)

    function myPreventPaste() {

    //debugger;

    event.returnValue = false

    }

    function myPaste() {

    event.returnValue = false

    try {

    //debugger;

    cd = window.clipboardData

    var txt = cd.getData("Text").toString()

    //cd.getData("Text").toString()

    txt = iged_stripTags(txt);

    iged_insText(txt,
    false, false);} catch(err){

    oEditor._alert();

    return;

    }

     

    }

     

Children