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.
Answers
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
@pallav
November 30,2017 At 11:53 AM
Solution #1