Printing a document in C# best approach RRS feed

  • Question

  • am searching for a namespace in C# through which i can "print and monitor printing".Currently i used 'process' to print a pdf ; But here i cannot monitor printing.Since process just throws document to printer.I went through Win32_Printer and System.printing both of them are dealing with "controlling/monitoring print jobs" but not printing a document.

    How i print now:

    ProcessStartInfo psInfo = new ProcessStartInfo();
    psInfo.Arguments = ConfigurationManager.AppSettings["printer_name"];
    psInfo.FileName = fileName;
    psInfo.WindowStyle = ProcessWindowStyle.Hidden;
    psInfo.Verb = "print";
    psInfo.CreateNoWindow = false;
    psInfo.UseShellExecute = true;
    process = Process.Start(psInfo);

    what WMI does: http://www.codeproject.com/Articles/6592/A-simple-approach-for-controlling-print-jobs-using and http://msdn.microsoft.com/en-us/library/aa394370.aspx

    All i need to do is check print status of a document i have printed at the moment.Printed or not!!

    Wednesday, November 27, 2013 6:11 AM