Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

I am stuck in a issue and still curious to know how I can find a dmCopies for a job in print queue. I have a system in place where only one print job is in the print queue all the time. I need to know No Of Copies user asked for this print job. That is basically "Copies" of each page / No or print Sets user requested.

I am trying to do this with VB.Net. Framework has bug in it where it always shows 1 as Copies. Can someone please guide on this.

Sample in VB.Net appreciated.

Thanks
Vinay H
Posted
Updated 8-Jan-20 8:03am

Since you didn't post any code, have you already tried PrintTicket class[^]

There's a good sample in the end for querying tickets.
 
Share this answer
 
Comments
Wendelius 11-Aug-11 12:46pm    
Ok, you could try using winspool directly. For example: http://pinvoke.net/default.aspx/winspool/DocumentProperties.html[^]

Side-note: Instead of adding a new solution, you can add a comment on an existing solution. This way the person who added the solution gets notified via email.
Thanks Mika, for your quick reply,
I have tried using PrintTicket, this property has a known bug. It returns 1 as copies all the time, No matter how many copies user prints.

Below is code for your reference. liCopies will always be 1.

If you have any workaround please do let me know. Any API sample would help aswell.

Appreciate Your Help.

---------------------
Dim lobjPrintJobs As PrintJobInfoCollection = lobjQueue.GetPrintJobInfoCollection()

For Each lObjJob As PrintSystemJobInfo In lobjPrintJobs


Dim liCopies As Integer
liCopies = lObjJob.HostingPrintQueue.CurrentJobSettings.CurrentPrintTicket.CopyCount()

Next

------------------
 
Share this answer
 
Comments
Wendelius 11-Aug-11 12:46pm    
See answer in solution 1.

mika
Thanks Mika, for your quick reply,
I have tried using PrintTicket, this property has a known bug. It returns 1 as copies all the time, No matter how many copies user prints.

Below is code for your reference. liCopies will always be 1.

If you have any workaround please do let me know. Any API sample would help aswell.

Appreciate Your Help.

---------------------
Dim lobjPrintJobs As PrintJobInfoCollection = lobjQueue.GetPrintJobInfoCollection()

For Each lObjJob As PrintSystemJobInfo In lobjPrintJobs


Dim liCopies As Integer
liCopies = lObjJob.HostingPrintQueue.CurrentJobSettings.CurrentPrintTicket.CopyCount()

Next
 
Share this answer
 
Comments
Bessax 8-Jan-20 14:03pm    
Hello,

Could you find a solution to this copy problems ???
Hello,

Could you find a solution to this copy problems ???
 
Share this answer
 
Comments
CHill60 8-Jan-20 18:08pm    
If you have a question then use the red "Ask a Question" link at the top of the page. Do not post questions or comments as solutions to old posts

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900