Total Pages problem in PrinterQueueWatch.dll
VB.NET, Printing, PrinterQueueWatch
5.00 (1 votes)

I am writing a program using PrinterQueueWatch.dll, locally works well but I have a problem when I implement it in a network, when I send jobs from other computers TotalPages (.PrintJob.TotalPages) shows as 0 every time.

I would appreciate if someone could help me with this problem.

 



27-11-2017 23:02:49


Answers

Solution #1

5.00 (2 votes)

TotalPages probelm exists in dll. I have also faced this issue. But I solved this by using e.PrintJob.TotalPages, e.PrintJob.PagesPrinted,e.PrintJob.Copies methods. Just used some calcualtion and it's worked somehow.

object printerName; object userName; object DocName; object PaperType; Int32 TotPage; object PrintDate;
                printerName = e.PrintJob.PrinterName;
                userName = e.PrintJob.UserName;
                DocName = e.PrintJob.Document;
                PaperType = e.PrintJob.PaperKind;
                TotPage = e.PrintJob.TotalPages;
                PrintDate = e.PrintJob.Submitted;

                Int32 stotPage = 0; Int32 stotPageP = 0; Int32 stotcopies = 0; Int32 stotCopiesF = 0; Int32 stotPagePF = 0;
                stotPage = e.PrintJob.TotalPages;
                stotPageP = e.PrintJob.PagesPrinted;
                stotcopies = e.PrintJob.Copies;
                if (stotPageP > 0 && stotPage > 0)
                {
                    if ((stotPageP / stotPage != stotcopies) && (stotPageP != stotPage))
                        stotCopiesF = stotPageP / stotPage;
                    else
                        stotCopiesF = e.PrintJob.Copies;
                }
                if (stotPageP < (stotPage * stotcopies))
                    stotPagePF = stotPage * stotcopies;
                else
                    stotPagePF = e.PrintJob.PagesPrinted;

Hope this helps yes



Pallav Kumar
30-11-2017 11:53:52


Search