Hi ,
There is a problem in MS Word formatting during paste when user click on Cancel and there is formatted text to paste then issue appear and shows some extra tags like “<st1:placename w:st="on">” , </st1:address></st1:street> etc and formatting gets destructed.
Could you please look into why when we hit on Cancel and then save the record, garbage tags are appeared to destruct the text formattng?
11 Answers, 1 is accepted
The dialog you see asks if you want RadEditor to remove these additional tags MS Word uses. If you click OK RadEditor will convert them to HTML. If you click cancel you will get the text MS Word provides, which includes these tags. You get the expected behavior when you cancel the cleaning operation.
If you want to avoid having that dialog you can define MS Word pasting options in the RadEditor settings so that it fits your needs. Generally, the less content you strip, the closer both documents will be, but the HTML will get lenghty. This is why we offer a set of options that can control this. More details and a way to test it is available in the following demo: http://demos.telerik.com/aspnet-ajax/editor/examples/cleaningwordformatting/defaultcs.aspx.
Regards,
Marin Bratanov
Telerik
Thanks
But I want to keep MS Word Formatting option also want to know the root cause why "<st1:placename w:st="on">” , </st1:address></st1:street>" etc tags are appearing when i click on Cancel.
Do these options are available for old version (Rad Editor) as well?
Regards
Shailesh Naik
In my case happening same, when pasting in Editor message comes to clean word formatting I used both the options (Ok,Cancel) but getting same text for both.
I want to keep option OK as a default (means it should remove unwanted formatting).
Can anyone please tell solution on this ?
Regards
Shailesh
Have you examined the demo I linked in my previous response to this thread: http://demos.telerik.com/aspnet-ajax/editor/examples/cleaningwordformatting/defaultcs.aspx? When the StripFormattingOnPaste or StripFormattingOptions property is set (they are equivalent, but you should use StripFormattingOptions), this dialog from the screenshot is suppressed and the value of the property determines what content is removed. Here is a sample editor that produces nice, clean HTML without much visual formatting:
<
telerik:RadEditor
ID
=
"RadEditor1"
Width
=
"600px"
runat
=
"server"
Height
=
"800px"
NewLineMode
=
"P"
StripFormattingOptions
=
"MSWordNoMargins, MSWordNoFonts, Css, Font, ConvertWordLists"
>
</
telerik:RadEditor
>
You may want to remove the Css and Font properties to keep colors and fonts from Word.
Perhaps a point of interest is that when ContentAreaMode=DIV with Chrome and Firefox a paste dialog will be shown because with an editable div these browsers do not exposes the needed paste events.
As for old versions - this property has been available for a long time, yet major improvements were made in Q1 2013 (http://blogs.telerik.com/aspnet-ajax/posts/13-04-17/seamless-paste-from-word-with-the-improved-telerik-asp.net-editor), so I strongly advise that you upgrade to the latest version.
Regards,
Marin Bratanov
Telerik
Hi Marin,
I am using Telerik rich text editor control in our web application with version having 2014.1.403.40
The problem is when i am pasting a text in editor with the option " StripFormattingOnPaste="MSWord" from the word document, it loses the font settings.
Please let me know how can i preserve this?
Regards
Ravi
Hi Ravi,
You can test the settings combination that works best for your case in the following demo: http://demos.telerik.com/aspnet-ajax/editor/examples/cleaningwordformatting/defaultcs.aspx.
For example, a combination of MSWordNoMargins and ConvertWordLists should give you just about all of the formatting available in MS Word. Here is a short video: http://screencast.com/t/Qy0t3b17Az.
Regards,
Telerik
Hi,
In MSWord i have a text with Font-Family : Calibri, Font-Size:14px
In the Rad Editor text box I copy & pasted that text, then selected that.
I see in the Editor Tool DropDown font-family is good, but font-size is getting changed to 19px .
May i know why? is there any fix for that?
FYI: if i see the same in html view it looks good. only in Editor tool DropDown it shows the wrong font-size & it is confusing.
Hello Arun,
The 14pt value from MS Word is equivalent to 19px and this is what RadEditor shows. This is the same in all browsers and our scripts calculate that value. Otherwise, IE would show the value in pt and all other browsers would show the value in px themselves which would cause inconsistent behavior in our control.
Regards,
Telerik
Hi Marin,
Pasting from word is not working in Firefox , not even in your demo site. try with bullets.following is the html generated from bullets
• A<br />
• B<br />
• C<br />
• D<br />
• E<br />
• F<br />
<br />
Hi Sajid,
I advise you review the following article to see how pasting in RadEditor works: http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/managing-content/pasting-content/overview.
I also advise that you test with the attached simple editable iframe, because RadEditor does not control the content, it comes from the browser. RadEditor can only clean up invalid markup coming from MS Word.
Considering the HTML I see, the issue is probably with the MS Word document. It is very likely that the bullets are merely bullet characters pasted in lines of text (not even in paragraphs), and not a real bullet list.
Regards,
Telerik