New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Print Content when using Div ContentAreaMode

You can find here a solution that shows how to create a custom Print tool that will print the contents of a div content area.

Example 1: Custom tool for printing the div content area.

<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>

See Also

In this article