How to print content?

10 posts, 0 answers
  1. Daniel
    Daniel avatar
    19 posts
    Member since:
    Nov 2010

    Posted 03 Oct 2011 Link to this post

    Hi

    How can i print the content of Richtextbox without using external apps? e.g. when no Word is installed on system?

    Thanks for a hint
    Daniel
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 05 Oct 2011 Link to this post

    Hello Daniel,

    Thank you for writing.

    Currently, RichTextBox does not support printing functionality. However, this is a great feature which we will consider for one of our next releases. I have added this feature request in our PITS system. Feel free to follow this link, where you can add your vote for this request.

    Your Telerik points have been updated for this feature request.

    I hope that you find this information helpful.
     
    Kind regards,
    Stefan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ken
    Ken avatar
    5 posts
    Member since:
    Jan 2013

    Posted 02 Feb 2013 Link to this post

    Any update on being able to print RichTextBox content?  It's been well over a year since the last update.
  5. Daniel
    Daniel avatar
    19 posts
    Member since:
    Nov 2010

    Posted 04 Feb 2013 Link to this post

    Hi Ken

    Yes, would be nice to see any progress on this.

    My temporary solution was to create a pdf and send it to a a networkspooler. (need to install a pdf-viewer also)

    using System.IO;
    using Telerik.WinControls.RichTextBox.FileFormats.Pdf;
    using System.Diagnostics;
     
            public static bool PrintTemplate(RadDocument template, string id)
            {
                try
                {
                    PdfFormatProvider pdfprovider = new PdfFormatProvider();
                    string filename = @Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\myapp\Temp\" + id + ".pdf";
      
                    if (File.Exists(filename))
                        File.Delete(filename);
      
                    FileStream output = new FileStream(filename, FileMode.Create);
      
                    pdfprovider.Export(template, output);
                    output.Close();
      
                    ProcessStartInfo startInfo = new ProcessStartInfo();
                    startInfo.FileName = filename;
                    startInfo.Verb = "printto";
                    startInfo.Arguments = @Properties.Settings.Default.DefaultURIPrinter; // \\servername\printershare
                    startInfo.CreateNoWindow = true;
                    startInfo.WindowStyle = ProcessWindowStyle.Hidden;
                    startInfo.UseShellExecute = true;
                    startInfo.ErrorDialog = true;
                    System.Diagnostics.Process.Start(startInfo);
                    return true;
                }
                catch (Exception exp)
                {
            //logerror...
                    return false;    
                }
              }

     
    Kind regards
    Daniel

  6. Ken
    Ken avatar
    5 posts
    Member since:
    Jan 2013

    Posted 04 Feb 2013 Link to this post

    Daniel,

    Thanks for the reply.  I ended up going down a similar path, too.  I created a class called PrintableRadRichTextBox that inherits RadRichTextBox and implements iPrintable and then basically did what you did (printing as PDF) in the BeginPrint method, with some clean-up in the EndPrint method.  I'm not 100% satisfied with it though.

    - Ken
  7. Plamen
    Admin
    Plamen avatar
    132 posts

    Posted 06 Feb 2013 Link to this post

    Hello guys,

    Thank you for writing.

    @ Daniel - Thank you for your community effort. Your Telerik points have been updated for your time and efforts.

    @ Ken - Currently, RadRichTextBox does not support printing functionality. However, RadRichTextBox allows you to export and import its content. So as a workaround, you could export your content to a PDF or DOCX document for example, and print it from the respective application. Please refer to our documentation articles about importing and exporting:

    Greetings,
    Plamen
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  8. Wayne
    Wayne avatar
    36 posts
    Member since:
    May 2013

    Posted 02 Dec 2013 Link to this post

    Any update on this?

    I'm seriously put off by the fact that there is a RichTextBox object and no one has thought to include some form of print-ability?  Seriously?

    In the words of Job, c'mon!  ;)  Makes absolutely no sense to me what-so-ever.  Now, because I know you're going to reply with "it's not in there, we'll see", I'm going to ditch the Telerik RichTextbox, ditch the nice print controls you have, in favor of the standard win controls.

    You can print a grid...because apparently people do that more often than a RichTextbox...
  9. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 04 Dec 2013 Link to this post

    Hi Wayne,

    Still, printing in RadRichTextBox is not supported, however there is some interest in such feature as you can see by the votes for it here: http://www.telerik.com/support/pits.aspx#/public/winforms/8027. Please add your vote for it (if you haven't already done so) in order to increase it priority among the other items. 

    We know this is a major feature and we do have plans for its implementation in a future release, however, for the time being we cannot provide any time frame for it.

    I hope that you find this information useful.

    Regards,
    Stefan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  10. Wayne
    Wayne avatar
    36 posts
    Member since:
    May 2013

    Posted 04 Dec 2013 Link to this post

    I've had to move on to other means of doing this...added my vote anyway.
  11. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 05 Dec 2013 Link to this post

    Thank you.

    Regards,
    Stefan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready