6

I need to get number of copies of a print job. I have its information in a JOB_INFO_1 record, but there is not any field for number of copies. How can I get this value?

Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467
Mahmoud_Mehri
  • 1,643
  • 2
  • 20
  • 38

1 Answers1

11

Instead of JOB_INFO_1, you will need to get a JOB_INFO_2 structure, which has a pointer to a DEVMODE structure, that in turn has a number of copies field. JOB_INFO_2 can be retrieved using GetJob, just as JOB_INFO_1.

GolezTrol
  • 114,394
  • 18
  • 182
  • 210
  • I've searching about how to use that in c# and I didn't found anything, can I do it in c#???, help me with a example – karelp90 Oct 02 '17 at 19:58
  • i also need a help regarding this matter... please provide some step by step if anyone succeed... – gumuruh Dec 31 '22 at 04:44
  • @gumuruh an karelp90 - This is a question for Delphi. I'm not sure if recent versions of .NET have a more abstract wrapper for handling print jobs, but there are various questions on SO and elsewhere about this Win32 API version. A common problem seems to be the incorrect definition of the required JOB_INFO_2 struct. Have a look [here](https://stackoverflow.com/questions/8082445/setjob-method-always-returns-122) or [here](https://stackoverflow.com/questions/47564653/why-get-wrong-total-page-of-n-up-printing-using-win32-printjob-c), for similar questions but for C#. – GolezTrol Dec 31 '22 at 13:25
  • thanks @GolezTrol... now i got the JOB_INFO_2 details along with the pointer of DEVMODE only. So how do I load the pointer become an Object properties.... thanks for the suggestions anyway! :D – gumuruh Jan 01 '23 at 03:05