Data format is lost on copying data from Microsoft word to Telerik RADEditor

9 posts, 0 answers
  1. Nisheet
    Nisheet avatar
    7 posts
    Member since:
    Mar 2019

    Posted 06 Mar Link to this post

    We are using a RADEditor in our solution with StripFormattingOptions attribute: StripFormattingOptions="MSWordNoMargins, ConvertWordLists, MSWord ". However, when content from a Microsoft word file is copied and pasted in the editor it loses its format. For example, Upper Case content is converted into lower case. I have tried multiple combinations of StripFormattingOptions attribute but still, the problem persists.

    One more point is that the behavior here is random, i.e. sometimes the format is maintained while sometimes it is lost. There is no specific format or case where this problem occurs. Hence, unable to identify the root cause as well.

    Request you to please assist for the same.

  2. Rumen
    Admin
    Rumen avatar
    14028 posts

    Posted 06 Mar Link to this post

    What happens if you set the StripFormattingOptions property to NoneSupressCleanMessage? Does the uppercasing remain or not?

    Can you provide a test Word file too?

    Regards,
    Rumen
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Nisheet
    Nisheet avatar
    7 posts
    Member since:
    Mar 2019

    Posted 06 Mar in reply to Rumen Link to this post

    Even after using "NoneSupressCleanMessage" the casing is not preserved and the format is lost. The forum is not allowing me to attach the docx file. Please guide me that how shall I share it.  

    Regards,
    Nisheet

  4. Nisheet
    Nisheet avatar
    7 posts
    Member since:
    Mar 2019

    Posted 06 Mar in reply to Rumen Link to this post

    Attaching the Word Doc content and the RADEditor output screenshots for your reference. The orange box content in the Word Doc screenshot loses its format and the green box content in the Word Doc screenshot loses casing.

    Regards,

    Nisheet

  5. Rumen
    Admin
    Rumen avatar
    14028 posts

    Posted 06 Mar Link to this post

    Hi,

    If the formatting is not preserved even when the NoneSupressCleanMessage is set, this means that it is not provided by the browser/OS clipboard.

    Can you send me the file to rumen.zhekov at progress.com?

    In the meantime you can paste it in an editable div/iframe (which is actually the content area of RadEditor) and see whether the formatting is preserved or not. Here is a test dojo project: http://dojo.telerik.com/@nlazarov/IFIPAR.


    Regards,
    Rumen
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  6. Nisheet
    Nisheet avatar
    7 posts
    Member since:
    Mar 2019

    Posted 06 Mar in reply to Rumen Link to this post

    Hi Rumen,

    I have sent you the docx file for which formatting and casing are lost on copy-paste. Also, I have tried pasting the data in the DIV/IFrame of the test dojo project but there also the formatting and casing are lost.

    Regards,

    Nisheet

  7. Rumen
    Admin
    Rumen avatar
    14028 posts

    Posted 07 Mar Link to this post

    Hi there,

    The fact that the formatting is not preserved when pasting the content in an editable iframe/div means that this feature is still not supported by the browser and the formatting is not converted to a valid HTML/CSS which the browser understands and can render. You can find more information and explanation in the following article: RadEditor and the Browser Clipboard.

    Regards,
    Rumen
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  8. Nisheet
    Nisheet avatar
    7 posts
    Member since:
    Mar 2019

    Posted 07 Mar in reply to Rumen Link to this post

    Thanks a lot, Rumen for answering my query. Just one more confirmation, so as per your answer it means that RadEditor will not preserve the format due to browser's limitation to convert it into valid HTML/CSS. I am currently using Google Chrome.

    Is there any browser with any specific version which supports proper conversion to HTML/CSS for the word document content. Or the only way to preserve the format is to edit the content format in the RadEditor itself.

  9. Rumen
    Admin
    Rumen avatar
    14028 posts

    Posted 08 Mar Link to this post

    Hi Nisheet,

    For the past years many of the browsers improved the conversion from Word to HTML. In the past a lot of junk HTML like <o:p>, mso tags and attributes came from the clipboard when pasting from MS Word, but now the things change for good and we can expect even better support for Word in the future.

    Presently, there isn't a 100% nicely working paste from Word, but usually the Microsoft browsers play a bit better with Word since it is a Microsoft product. This does not mean that everything will come 1:1 from Word but you can test.

    It depends on the content of the Word file too. If they are created in Word they might be converted better, but if they are pasted from another program in Word, the contents might be malformed and mangled and this can cause troubles too.

    Best regards,
    Rumen
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top