Print html document from Windows Service without print dialog

Posted by Anup Pal on Stack Overflow See other posts from Stack Overflow or by Anup Pal
Published on 2009-01-07T06:41:39Z Indexed on 2010/04/16 0:53 UTC
Read the original article Hit count: 472

Filed under:
|
|

I am using a windows service and i want to print a .html page when the service will start. I am using this code and it's printing well. But a print dialog box come, how do i print without the print dialog box?

public void printdoc(string document)
{
    Process printjob = new Process();

    printjob.StartInfo.FileName = document;
    printjob.StartInfo.UseShellExecute = true;
    printjob.StartInfo.Verb = "print";
    printjob.StartInfo.CreateNoWindow = true;
    printjob.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

    printjob.Start();
}

Have there any other way to print this without showing the print dialog box.

© Stack Overflow or respective owner

Related posts about c#

Related posts about printing