Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ VC++
Hi,
I want to know how many pages printed for a task that is given to printer through programming using c++ or vc++.
 
Adding some more information:
 
yes the file types that my program sending are DOC and PDF. After printing i need to log the data in how many pages are printed for that file for that user.
 
Some time i will not send total file ,i will send some selected pages or text also.
 
All just i wanted is how many of pages printed for that job in C++/VC++.
 
Tanks in advance.
Posted 4-Mar-13 1:57am
y3ec255169
Edited 4-Mar-13 7:23am
v2
Comments
Richard MacCutchan at 4-Mar-13 7:30am
   
Do you mean a print file that your program is sending, or some other file?
y3ec255 at 4-Mar-13 12:21pm
   
yes the file types that my program sending are DOC and PDF. After printing i need to log the data in how many pages are printed for that file for that user.
 
Some time i will not send total file ,i will send some selected pages or text also.
 
All just i wanted is how many of pages printed for that job in C++/VC++.
Richard MacCutchan at 4-Mar-13 12:23pm
   
Well if you are sending the file then you will know in advance how many pages are to be printed.
YvesDaoust at 4-Mar-13 12:37pm
   
How do you submit the documents for printing ? Only this "print handler" knows how many pages were requested per document.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can subscribe to Windows print spooler notification functions, as FindFirstPrinterChangeNotification, FindNextPrinterChangeNotification with interest of JOB_NOTIFY_FIELD_TOTAL_PAGES, JOB_NOTIFY_FIELD_PAGES_PRINTED. Or you can examine Windows logs for the same information, using OpenEventLog on Windows XP or EvtSubscribe on Vista and later. And you can do it from printing process.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 George Jonsson 175
1 Kornfeld Eliyahu Peter 169
2 Zoltán Zörgő 139
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 5 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100