Click here to Skip to main content
14,427,367 members
Rate this:
Please Sign up or sign in to vote.
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 9:03am
Rate this:
Please Sign up or sign in to vote.

Solution 1

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

There's a good sample in the end for querying tickets.
   
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.
Rate this:
Please Sign up or sign in to vote.

Solution 2

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

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

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

Solution 3

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
   
Comments
Bessax 8-Jan-20 14:03pm
   
Hello,

Could you find a solution to this copy problems ???
Rate this:
Please Sign up or sign in to vote.

Solution 6

Hello,

Could you find a solution to this copy problems ???
   
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100