This is a migrated thread and some comments may be shown as answers.

Radeditor Strip font not working when content paste from pdf document.

1 Answer 155 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Nimesh
Top achievements
Rank 1
Nimesh asked on 04 Aug 2011, 09:56 AM
Hi,

RadEditor strip font not working when content paste from pdf document.

I am using the RadEditor (version: 2011.1.315.40) with edit form as a model popup.

Below is code snippet that I used in my application

<telerik:RadEditor ID="RadEditor1" runat="server" SpellCheckSettings-DictionaryPath="../RadSpellControl/TDF/"
    EditModes="Design" BorderStyle="None" BorderWidth="0px" Height="129px" Width="250px"
        ContentAreaCssFile="~/css/radeditor.css" OnClientPasteHtml="OnClientPasteHtml"
        OnClientLoad="InitialDescriptionText">
        <Tools>
            <telerik:EditorToolGroup>
                    <telerik:EditorTool Name="Bold" />
                        <telerik:EditorTool Name="Italic" />
                        <telerik:EditorTool Name="Underline" />
                </telerik:EditorToolGroup>
                <telerik:EditorToolGroup>
                        <telerik:EditorTool Name="InsertOrderedList" Text="Ordered List" />
                </telerik:EditorToolGroup>
                <telerik:EditorToolGroup>
                          <telerik:EditorTool Name="PasteFromWordNoFontsNoSizes" />
                 </telerik:EditorToolGroup>
        </Tools>
</telerik:RadEditor>


I have a client application that allows them to enter comments into the RadEditor with Bold, Italic, Underline and numbering option only. so when any content pasted in

RadEditor is strip all style and css except Bold, Italic, Underline and numbering option. that's thing working properly in when content paste from ms-word document for

IE and Firefox browser.

But when content copied and paste from any pdf document then it works only for IE properly with help of "Paste from Word, strip font" button.

but in Firefox, it remove(striped) all style and css with Bold, Italic, Underline and numbering option with help of "Paste from Word, strip font" button..


Could you let me know what is reason of it is not working when the contents are copied from pdf document?


Awaiting for response.


Regards,

Nimesh 

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 09 Aug 2011, 11:54 AM
Hi Nimesh,

Let me explain in details what is happening when pasting content from PDF, MS Word, MS Excel or other program. The paste process is controlled entirely by the Operating System and by the browser. The editor is not allowed to interfere in this process much (of course there are some minor differences between browsers). Thus, with respect to pasting - the original PDF formatting is not HTML but specific formatting. When this is exported to the clipboard, and is made available for paste, it "announces" what "paste flavors" it supports - and those would be HTML, Plain text, XML, RTF and so on.

When a client entity (such as the editor) wants to consume the content of the clipboard, it announces what paste formats it supports (and the editor - any editor - only supports plain text and HTML). It is up to the browser to decide which format to paste in an editable IFRAME element such as the content area of RadEditor. So it is Firefox which converts the PDF formatting to plain text before pasting it in the editor and this is browser limitation.

You can see my test with an editable iframe in Firefox and IE and you will see that this process in browser related and cannot be handled by code.


Best wishes,
Rumen
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Editor
Asked by
Nimesh
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or