Page Reconcilation issue

May 8, 2009 at 11:06 AM

There is quite a huge problem with this dll.

1. My program is not able to identify between the really printing. Suppose one User fired a print on the Printer..but it was not actually printed due to either Paper jam in printer, page tray empty, printer not empty or it was cancelled manually by user from the print queue before printing. My program simply records that document and number of page but does not record whether it was really printed. CAN ANY ONE HELP ME HOW DO I IDENTIFY WETHER THE PAGE WAS ACTUALLY PRINTED

I Though of using the Printed and Printing method to determine weather it was printed or not... But i found it is not consistent in retruning the value..

2. If my document contain 1 Color page and 99 Black&White page it register in the log as 100 Color page printed..but actually it is 1 color and 99 B/W. CAN ANY ONE HELP ME HOW TO SPLIT THE DETAILS OF THIS JOB LOG INTO TWO

3. There are huge number of Write Log generated for single job while Add and Delete is fairly OK. Example if i give 10 page print..It generate sme time 20-25 log for Write type. Any way i count the page by reading the Delete type

Coordinator
May 8, 2009 at 7:15 PM

1.  The PrintJob.PagesPrinted should have the number of pages printed.  The PrintJob.Status will tell you if there is a paper jam or whatever.  In the JobDeleted event if Printed is True and PagesPrinted >0 then some pages were printed.

2.  This property records what the print job was set to (Colour or Black and White) on the job.  It will only be false if the print job is set to print the whole job in black and white.

3. A JobWritten event occurs whenever any data are written to the spooler or from the spooler to the printer.  It is reasonable for this to happen very many times per print job.

 

The history of a print job is Job Added followed by one ore more Job Written (and possibly one of more Job Set) followed by one Job Deleted event.

May 11, 2009 at 6:47 AM

 

Hi Merrion,

Thanks for the reply..But still not clear with the reply

I have some realistic situation in which the reconcilation of the Page count will not happen

I have install my program as a service on the Print Server where there are firm wide user prinitng via that Print Server

All the job go to the printer via Print server so my program can detect all the job fired by the user

But the bad thing is that Printer cannot communicate back to the Print server on weather printing had really happened

Example 1

- User gave 10 page printing

- My program on Print server records 10 page on the log file

- But on printer after 5 pages were printed user cancel the last 5 page

At last: User printed only 5 pages but my program had 10 page record

Example 2

- User gave 10 page printing, but it was secured printing means the printing will not happen but it will just get stored on the hard disk of the Printer on which the printing is fired

- My program on Print server simply record te 10 pages

- Later it is up to user weather he/she want the printing. If they wanted they will go to the Printer and select their document and print

- If they did not print then there is the Page count issue

There are plenty of more but if you can help me sort out this problem i can do the rest

<font face="Helv" size="2">

Regarding your answer no 3 i.e.

</font>

 

A JobWritten event occurs whenever any data are written to the spooler or from the spooler to the printer. It is reasonable for this to happen very many times per print job.

I am recording the logs in the text file and there is continues printing happening.

If i keep the record type written it will create a huge logs and at the end of the day i will have a log which is more then 100 MB size.

The problem of big size is that my program which read this log and store the detail in a datababse is on different server and different countires so it takes more than half an hour to copy the log file

So i decided NOT to use the Write type in my log and just use Add and Delete type . Will this impact my Page counting ?

Question 2

My service is on the print server which is always on 24 x 7

If my Program runs continously for serveral days..will it have any impact like program crashing down.

Hope you can help me more with your precious suggestion and comment

May 13, 2009 at 11:35 AM

Hi,

the problem is the fact that most of the printers' memories
are big enough nowadays to retrieve the complete print job
to the printer, that is, the print job is not in the print queue
on the print server after it has been sent to the printer.


To be able to count the correct number of pages printed out physically
I am using SNMP to read the Page Counter from the printer before
and after the print job.

Steps involved (summarized):

- Monitor incoming print jobs with the PrinterQueueWatch component
- when a new print job is added --> pause it and wait that it finishes spooling
- log all necessary fields to a database (also including the "logical"
  page count)
- wait until the printer status is "ready", "sleeping",... or any other
  status telling that the printer is ready to print
  (with SNMP check the status of the printer)
- when ready "lock" the access to the printer only to this current
  print job (all other print jobs will stay paused)
- read the printer's page count (with SNMP)
- resume the print job
- wait until the printer reports back "ready", "sleeping",....
- read the printer's page count again (with SNMP)
- now you have the pages printed physically
- unlock the access to the printer and the first print job in the
  queue to catch the lock will print as described above.
- update the database with the correct pages
  (I have actually two columns: LogicalPageNumbers, PhysicalPageNumbers)


I have seen that even some commercial products are not reporting the
correct page count if there is i.e. a paper jam.


Disadvantages of the steps above:
- old printers might not support SNMP
- only one print job will be sent to the printer at any given time
- if you use a payment system you definitely want to charge the user
  before the print job is getting printed
  (in this case I charge the user with the "logical" page count but
  after I know the physical page count I update the balance if physical
  page count differs)

Unfortunately, I haven't used the approach that users need to go
to the printer and select their print jobs to print.

Best regards,
Johann

May 14, 2009 at 11:07 AM

I have never program SNMP...do you have any sample SNMP program to read the Printers and get the details

May 15, 2009 at 10:37 AM

Hi,

I have been using the snmpget.exe tool but right now I am
testing to use the #SNMP Suite.

You can find it at: http://sharpsnmplib.codeplex.com/


If you need some test code please send me your contact
email and then I can send you some short example.

Best regards,
Johann

Aug 25, 2009 at 2:46 PM

Hi Johann

I start looking at using SNMP to check the status of the printer before printing a document. Can SNMP check a printer attatched computer? How?

Thanks

Carey

Aug 26, 2009 at 8:17 AM
Edited Aug 26, 2009 at 8:19 AM

Hi Carey,

I have just send you a sample code how to use the #SNMP Suite.

You can check the status of any printer as long as there is a connection between the application running the SNMP query and the printer.

If you have connected a printer i.e. over USB/LPT1 and your software is running at the print server I doubt that
you can query the status - unless you somehow have a client/server solution where the the server is asking the client (where the printer
is connected) to make the SNMP query over there and return the results to the server.

@everyone: A code snippet I have found helpful is at:

http://sharpsnmplib.codeplex.com/Thread/View.aspx?ThreadId=46943

Have a look at the SimpleGet method.

Best regards,
Johann

 

Feb 3, 2010 at 5:33 PM
codepunkt wrote:

Hi,

the problem is the fact that most of the printers' memories
are big enough nowadays to retrieve the complete print job
to the printer, that is, the print job is not in the print queue
on the print server after it has been sent to the printer.


To be able to count the correct number of pages printed out physically
I am using SNMP to read the Page Counter from the printer before
and after the print job.

Steps involved (summarized):

- Monitor incoming print jobs with the PrinterQueueWatch component
- when a new print job is added --> pause it and wait that it finishes spooling
- log all necessary fields to a database (also including the "logical"
  page count)
- wait until the printer status is "ready", "sleeping",... or any other
  status telling that the printer is ready to print
  (with SNMP check the status of the printer)
- when ready "lock" the access to the printer only to this current
  print job (all other print jobs will stay paused)
- read the printer's page count (with SNMP)
- resume the print job
- wait until the printer reports back "ready", "sleeping",....
- read the printer's page count again (with SNMP)
- now you have the pages printed physically
- unlock the access to the printer and the first print job in the
  queue to catch the lock will print as described above.
- update the database with the correct pages
  (I have actually two columns: LogicalPageNumbers, PhysicalPageNumbers)


I have seen that even some commercial products are not reporting the
correct page count if there is i.e. a paper jam.


Disadvantages of the steps above:
- old printers might not support SNMP
- only one print job will be sent to the printer at any given time
- if you use a payment system you definitely want to charge the user
  before the print job is getting printed
  (in this case I charge the user with the "logical" page count but
  after I know the physical page count I update the balance if physical
  page count differs)

Unfortunately, I haven't used the approach that users need to go
to the printer and select their print jobs to print.

Best regards,
Johann

 

Hi, Johann

I'm developing a Printer Monitoring Software using printerqueuewatch and snmpsharpnet components. Actually I can get logical page count from job information using  printerqueuewatch, and I'm trying to get physical printed pages using SNMP.

I followed the steps above, and the problem I'm having is:

pause job when added (ok);

check printer status using SNMP and wait online (OK);

lock printer and get current printer page count using SNMP (OK);

resume job (ok);

wait printer status online again using SNMP --> sometimes, the printer gets online before the end of printing when multiple pages are printed, then the printer get printing status againd, online status again, ... until total job is printed.

My question is: How can I know when the entire job get printed  ???/

 

Best regards,

Ademir Silva.