locked
how to get notified when a printer runs out of paper using c#? RRS feed

  • Question

  • User31862606 posted

    Hi All

    I'm using the below code to print a document , so my question is how do i get notified when the printer runs out of paper or ink  using c#?

    C# code

    PrintDocument pd = new PrintDocument();

    PrintController pc = new StandardPrintController();
    pd.PrintController = pc;
    pd.PrintPage += new PrintPageEventHandler(pqr);
    pd.Print();

    void pqr(object o, PrintPageEventArgs e)
    {
    var path1 = @"e:\abc.jpeg";
    System.Drawing.Image i = System.Drawing.Image.FromFile(path1);
    Point p = new Point(0, 0);
    e.Graphics.DrawImage(i, p);
    }

    thanks in advance

    Jeeva

    Monday, June 2, 2014 4:32 PM

All replies