We have few printers connected in the network (LAN) setup with no domain controller. The printers are given specific IP addresses. I wish to log all the printer activities to a database (or file-system). Also I want to control the printers, for example, if any user (from a IP address) wishes to print in landscape but one my printers is configured only for printing in portrait, the printer should reject the print. Another example is that if a user has exceeded the print limit (number of pages), the printer should not print the next page.
I have no idea of achieving this. Kindly give your valuable suggestions. Code snippets, ideas are most welcome.
Please check out the Print Spooler API Functions over at MSDN: http://msdn.microsoft.com/en-us/library/dd162861(v=VS.85).aspx
How To Call Win32 Spooler Enumeration APIs Properly: http://support.microsoft.com/kb/158828
How to get the status of a printer and a print job: http://support.microsoft.com/kb/160129
Sample Code: