Print html or any files from Windows form using C#

Using this code you would be able to print any type of pages.

just copy and paste this code on any button event handler.

private void buttonPrint_Click(object sender, EventArgs e)
Process printProc = new Process();

 printProc.StartInfo.FileName =” yourFileName“;
printProc.StartInfo.UseShellExecute = true;
printProc.StartInfo.Verb = “print”;
printProc.StartInfo.CreateNoWindow = true;
printProc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
catch (Exception ex)
MessageBox.Show(ex.Message, “Jawed Blog say!!”, MessageBoxButtons.OK, MessageBoxIcon.Error);


Md. Jawed


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s