how i get print out from printer via using c # code
....................................

if any buddy has solution give me code


thank u .

I have developed shareware program where it is possible to draw form and reports, then print it out.

Small sample from it
I was copied some lines from my software, and hoping it is workable and understandable.

using System.Drawing;
using System.Drawing.Printing;
using System.IO;
using System.Windows.Forms;
namespace xxx 
{
        public void PRINTOUT()
        {
            PrintDialog pd = new PrintDialog();
            pd.Document = new PrintDocument();
     
            if (pd.ShowDialog() == DialogResult.OK)
            {
                pd.Document.PrintPage += new PrintPageEventHandler (PrintPage);            
                pd.Document.Print();
            }
         }
         private void PrintPage(object sender, PrintPageEventArgs ev)
         {
              ev.Graphics.DrawString("* * Header * * ", Font, Brushes.Black, 100, 100);     //Print header text, Font has been
                                                                                            //defined elsewhere (in form ?)
              ev.HasMorePages=false;                                                       // Last Page (1 page)
         }
 }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.