Print Issue in RadEditor

7 posts, 0 answers
  1. Vijay
    Vijay avatar
    12 posts
    Member since:
    Oct 2010

    Posted 13 Sep 2011 Link to this post

    Hi Telerik Team,

    I have an issue with radeditor while Printing i.e When you enter text  until radeditor has got some scroll bars and if you print that, all text is not getting printed.i have attached a sample PrintOut. Can u Please help me out in this issue.

    Thanks,
    vijay.
  2. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 13 Sep 2011 Link to this post

    Hi Vijay,

    You should use the Print button of RadEditor to print the editor's content but not the Print button of the browser.
    See the attached video for more information: http://screencast.com/t/DHERogyd.

    Best wishes,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vijay
    Vijay avatar
    12 posts
    Member since:
    Oct 2010

    Posted 13 Sep 2011 Link to this post

    Hi Rumen,

    Thanks For the Reply.

        i cant use that print button given in radeditor as radeditor is a part of my webpage which has many other controls and i've got seperate link in the web page to get it Printed.

    Thanks,
    Vijay.
  5. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 13 Sep 2011 Link to this post

    Hi Vijay,

    The browser cannot print the hidden content inside the editable iframes, divs, textareas as the content area of RadEditor.

    In your case I suggest setting the AutoResizeHeight property to true in all RadEditors on the page so that their contents become visible on the page and can be printed.

    Greetings,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Vijay
    Vijay avatar
    12 posts
    Member since:
    Oct 2010

    Posted 13 Sep 2011 Link to this post

    Thanks For the Quick Response Rumen,


    As u Said i could set autoresize property to true but as per the client requirements i have to show radeditor on web page with some fixed height with out changing .
    Can we set this autoresize property through javascript only while the time of  printing and set back to original after the print command completes? 

    Thanks,
    vijay.

  7. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 13 Sep 2011 Link to this post

    Hello Vijay,

    The AutoResizeHeight property can be set on the server only.

    The other possible approach is to get the editors contents on the client using editor.get_html(true), set it in a hidden iframe element on the page and print the content of the iframe element. If you unable to implement your scenario with RadEditor implement it with textarea elements. After that send us the code and we will replace the textareas with RadEditor controls and send you the updated code.

    You can see how to print the content of multiple editors in this help article: Printing Content with Styles. You should create an iframe element and in the printDocument.write method to add the content of all editors.

    Kind regards,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. <span>w</span>
    <span>w</span> avatar
    84 posts
    Member since:
    Jun 2012

    Posted 29 Mar 2013 Link to this post

    Hi Rumen

    When i try to print radeditor using javascript. it is not printing radeditor according to my desired. i also attach image when i click on print link. Can you please check this?

         <script language="javascript" type="text/javascript">
              function PrintableDiv() {

                  var radGrid = document.getElementById('tblPrint').innerHTML;
                  var previewWnd = window.open('about:blank', '', '', false);
                  var styleStr = "<html><head> <meta http-equiv='X-UA-Compatible' content='IE=8' /><title>Test Sample</title>";
                  styleStr += "<style type='text/css'>.html{ padding: 0; margin: 0; height: 100%; } .body { padding: 0; margin: 0; height: 100%; } .form { padding: 0; margin: 0; height: 100%; }";
                  styleStr += "</style></head>";

                  var htmlcontent = styleStr + "<body>" + radGrid + "</body></html>";
                  previewWnd.document.open();
                  previewWnd.document.write(htmlcontent);
                  previewWnd.document.close();
                  previewWnd.print();
                  previewWnd.close();
              }
          </script>
          
        <form id="form1" runat="server">
            <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
            </telerik:RadScriptManager>
            
                  <div id="tblPrint" name="tblPrint">
                        <telerik:RadEditor ID="radEditor" runat="server" ToolbarMode="Default" BorderStyle="None" EditModes="Design" BorderWidth="0" BorderColor="Transparent" ExternalDialogsPath="~/EditorDialogs"  runat="server" Height="190" Width="100%">
                           <CssFiles>
                                <telerik:EditorCssFile Value="~\hris/css/FAQRadEditor.css" />
                            </CssFiles>
                            
                               <Tools>
                                <telerik:EditorToolGroup>
                                    <telerik:EditorTool Name="Bold" />
                                    <telerik:EditorTool Name="Italic" />
                                    <telerik:EditorTool Name="Underline" />
                                    <telerik:EditorTool Name="ForeColor" />
                                    <telerik:EditorTool Name="InsertSymbol" />
                                </telerik:EditorToolGroup>

                                <telerik:EditorToolGroup>
                                    <telerik:EditorTool Name="InsertUnorderedList" />
                                    <telerik:EditorTool Name="InsertOrderedList" />
                                </telerik:EditorToolGroup>

                                <telerik:EditorToolGroup>
                                    <telerik:EditorTool Name="Outdent" />
                                    <telerik:EditorTool Name="Indent" />
                                </telerik:EditorToolGroup>  

                                <telerik:EditorToolGroup>
                                    <telerik:EditorTool Name="JustifyLeft" />
                                    <telerik:EditorTool Name="JustifyCenter" />
                                    <telerik:EditorTool Name="JustifyRight" />
                                </telerik:EditorToolGroup>
                                 
                                <telerik:EditorToolGroup>
                                        <telerik:EditorTool Name="LinkManager"/>
                                </telerik:EditorToolGroup>                                                                                                                                                                             
                                                                                           
                                <telerik:EditorToolGroup>
                                    <telerik:EditorToolStrip Name="InsertTable" />
                                </telerik:EditorToolGroup>
                                
                                </Tools>
    <Content>
    </Content>
                        </telerik:RadEditor>
                </div>
                
                <a href="#" onclick="PrintableDiv()">Printable div</a>




    Thanks,
    Muhammad Waseem
    the Telerik team
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017