Copy paste from Word Into Editor Changes the Line Height

8 posts, 0 answers
  1. Shikhar
    Shikhar avatar
    5 posts
    Member since:
    Oct 2015

    Posted 01 Oct 2015 Link to this post

    Hi,
    I  have a problem with Editor. When I copy content from word and paste it in the Editor (Ctrl+V) in our website line height automatically changes even if I set the StripFormattingOptions property to ‘NoneSupressCleanMessage’.
    I have also tried this on telerik’s demo site and the issue occurs there as well:
    http://demos.telerik.com/aspnet-ajax/editor/examples/cleaningwordformatting/defaultcs.aspx
    See the snapshot of the original document and the content after pasting in the radeditor
    You can see that in the html mode the line height is being set to 115%. The line height should have been identical to that in MS Word
    Please I need this issue to be solved ASAP.

     

    I have attached the snapshots of the site and word file

  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 01 Oct 2015 Link to this post

    Hi,

    When StripFormattingOptions  property is set to NoneSupressCleanMessage, RadEditor does not pass the pasted content through the stripping filters. Therefore, the described behavior is entirely depended on the browser. 

    In order to configure RadEditor to properly clean-up MS Word content you should either leave the default options of the StripFormattingOptions  property or configure it based on your needs. You can read more about pasting in RadEditor here—http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/managing-content/pasting-content/overview.

    Regards,
    Ianko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Shikhar
    Shikhar avatar
    5 posts
    Member since:
    Oct 2015

    Posted 05 Oct 2015 Link to this post

    I found that you are right. The line height is indeed browser dependent. That being said, can you please provide a custom code that solves this problem and matches the line height of the content pasted in the Editor to that in the MS Word document.

     

    Thanks

  5. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 05 Oct 2015 Link to this post

    Hello,

    I am not quite sure what custom code could achieve the required results. When it comes to custom solutions, it is best for them to be implemented manually so to best fit the scenario there is. 

    Since there are built-in options regarding pasting from MS Word, I can definitely recommend them for the job. Please, follow the link provided in my previous post. 

    Regards,
    Ianko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Shikhar
    Shikhar avatar
    5 posts
    Member since:
    Oct 2015

    Posted 14 Oct 2015 Link to this post

    Hi i have tried the various pasting options and have also tried all the StripFormattingOptions including 'None' but the line height remains inconsintent with that in the MSWord document. I also tried various combinations for StripFormattingOptions including ' ConvertWordLists + MSWordNoMargins' but  the problem still persists. Kindly help me with a solution as it is very crucial.

    Thanks

  7. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 15 Oct 2015 Link to this post

    Hi Shikhar,

    The only possible way is to investigate why and what HTML code is generated on pasting so that the empty lines appear. Further, you can create you own logic to strip out the not needed HTML by using the pasteHtml event—http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/client-side-programming/events/onclientpastehtml.


    Regards,
    Ianko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  8. Shikhar
    Shikhar avatar
    5 posts
    Member since:
    Oct 2015

    Posted 15 Oct 2015 Link to this post

    If I am not wrong  the onClientPasteHtml does not work when StripForamttingOptions ​is set to 'NoneSupressCleanMessage'. Now the other ways i tried are:
    1. 'None'. But this gives a dialogBox every time i copy from MSWord and paste into the Editor.
    2.Combination of 'ConvertWordList' and 'MSWordNoMargin'. But this disturbs the margins of the content.

    Now is there a way that onclientpastehtml can be called without getting a DialogBox every time and not disturbing the margins??
  9. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 16 Oct 2015 Link to this post

    Hello,

    You can try using MSWord and ConvertWordLists options only.

    Regards,
    Ianko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017