This is a migrated thread and some comments may be shown as answers.
Copy paste from Word Into Editor Changes the Line Height
7 Answers 39 Views
This is a migrated thread and some comments may be shown as answers.
Shikhar
Top achievements
Rank 1
Shikhar asked on 01 Oct 2015, 12:30 PM

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

7 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 01 Oct 2015, 01:03 PM
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
0
Shikhar
Top achievements
Rank 1
answered on 06 Oct 2015, 03:47 AM

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

0
Ianko
Telerik team
answered on 06 Oct 2015, 04:47 AM
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
0
Shikhar
Top achievements
Rank 1
answered on 14 Oct 2015, 09:33 AM

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

0
Ianko
Telerik team
answered on 15 Oct 2015, 08:53 AM
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
0
Shikhar
Top achievements
Rank 1
answered on 16 Oct 2015, 04:03 AM
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??
0
Ianko
Telerik team
answered on 16 Oct 2015, 05:00 AM
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
Asked by
Shikhar
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Shikhar
Top achievements
Rank 1
Share this question
or