Completed
Last Updated: 18 Apr 2022 14:35 by ADMIN
ADMIN
Ianko
Created on: 14 Oct 2013 06:25
Category: Editor
Type: Feature Request
2
Fix problem with the Print method when the RadEditor's ContentAreaMode is Div
When RadEditor's ContentAreaMode is Div the entire page is printed instead of just the content. 

Possible solution is changing the mode to Iframe as it is by default. 
1 comment
ADMIN
Rumen
Posted on: 18 Apr 2022 14:34

You can use the solution provided in the following KB article: 

Print Content when using Div ContentAreaMode, e.g.

<telerik:RadEditor RenderMode="Lightweight" ID="RE1" runat="server" ContentAreaMode="Div">
    <Content>
        <h1>Title</h1>
        <p>Some content.</p>
    </Content>
    <Tools>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="Print" />
        </telerik:EditorToolGroup>
    </Tools>
</telerik:RadEditor>

<script>
    Telerik.Web.UI.Editor.CommandList["Print"] = function (commandName, editor, args) {
        var prtContent = editor.get_contentArea();
        var WinPrint = window.open('', '', 'left=0,top=0,width=800,height=900,toolbar=0,scrollbars=0,status=0');
        WinPrint.document.write(prtContent.innerHTML);
        WinPrint.document.close();
        WinPrint.focus();
        WinPrint.print();
        setTimeout(function () {
            WinPrint.close();
        }, 1000);

    };
</script>