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

How to print content?

9 Answers 82 Views
RichTextBox (obsolete as of Q3 2014 SP1)
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 03 Oct 2011, 07:48 AM
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

9 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 05 Oct 2011, 11:21 AM
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 >>

0
Ken
Top achievements
Rank 1
answered on 02 Feb 2013, 06:09 PM
Any update on being able to print RichTextBox content?  It's been well over a year since the last update.
0
Daniel
Top achievements
Rank 1
answered on 04 Feb 2013, 09:34 PM

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

0
Ken
Top achievements
Rank 1
answered on 04 Feb 2013, 09:50 PM
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
0
Plamen
Telerik team
answered on 06 Feb 2013, 06:39 PM
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.
0
Hannah
Top achievements
Rank 2
answered on 02 Dec 2013, 09:44 PM
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...
0
Stefan
Telerik team
answered on 04 Dec 2013, 09:36 AM
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 >>
0
Hannah
Top achievements
Rank 2
answered on 04 Dec 2013, 04:48 PM
I've had to move on to other means of doing this...added my vote anyway.
0
Stefan
Telerik team
answered on 05 Dec 2013, 07:37 AM
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 >>
Tags
RichTextBox (obsolete as of Q3 2014 SP1)
Asked by
Daniel
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Ken
Top achievements
Rank 1
Daniel
Top achievements
Rank 1
Plamen
Telerik team
Hannah
Top achievements
Rank 2
Share this question
or