• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 661
  • Last Modified:

HOWTO: Pring job success?"

How can I tell if a print job was successfuly printed?

(No speculations please, I need something known to work with all printers).

The spooler API failed me so far, but maybe I'm missing something.
0
shaig
Asked:
shaig
  • 4
  • 3
1 Solution
 
NickRepinCommented:
GetJob(..Jobid...)
If Status==JOB_STATUS_PRINTED then the job is printed.

If Status==JOB_STATUS_DELETING or if
GetJob() returns an error value (job not found), then the job is either successfully printed and then automatically deleted, or deleted by the operator on any stage, there is no way to determine whether the job was successfully printed or not.
0
 
shaigAuthor Commented:
I never get the JOB_STATUS_PRINTED.
Besides, after the job is deleted the structure containing the job info looks somewhat curropt.
Any ideas?

0
 
NickRepinCommented:
The time when job is in JOB_STATUS_PRINTED state may be (usually) no more than several tenths of second. Because it is deleted immediately when it is printed.

Job structure is invalid once the job is deleted.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
NickRepinCommented:
When you set 'Keep job after it has been printed' flag for a printer, you'll see all your jobs inJOB_STATUS_PRINTED state.
0
 
shaigAuthor Commented:
Can this flag be set programatically?
0
 
NickRepinCommented:
GetPrinter(hPrinter,2,..)

PRINTER_INFO_2.Attributes |=PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS;

SetPrinter(hPrinter,2,..)

0
 
shaigAuthor Commented:
Thanks you.
0
 
BegginerCommented:
Hi Shaig,
 Can u pls tell me how did u get the job id and how did u checked the print status..if have batch script for this pls  post that...
pls i am in need  of  this

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now