0

How can i send Printdocument to richtextbox so i can write something above text and send it as email.

here is code:

private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                PrintDocument pd = new PrintDocument();
                pd.PrintPage += new PrintPageEventHandler(this.PrintPageEventHandler);
               
                if (this.storedPageSettings != null)
                    pd.DefaultPageSettings = this.storedPageSettings;
                PrintPreviewDialog dlg = new PrintPreviewDialog();
                
                dlg.Document = pd;
                dlg.Width=800;
                dlg.Height = 800;

                dlg.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

any help is appreciated

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by denonth
0

Use, instead "Window.Print()" Method. Hope it helps u. Sorry, it will work only for the Web Application. And if ur application is an web app then use it in onclick event of any button. It will work.

Edited by akshintlakalyan: n/a

0

Use, instead "Window.Print()" Method. Hope it helps u. Sorry, it will work only for the Web Application. And if ur application is an web app then use it in onclick event of any button. It will work.

I am using windows application. Problem is that I don't know if that is really a convertable type..you know from printdocument to string or stringbuilder

So I would really need help...That is the last thing in my project to do.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.