win32 print queue

L

linuxnooby

Hi

Is it possible to control a windows XP/2000 print queue using java?

What I want to do is have java dialogue box appear when the user prints
from any application (web browser , Word etc). The dialogue box would
say "this is 3 pages it will cost 60 cents, do you want to proceed?" If
the user clicks OK then the print job runs, otherwise print job is
deleted. Is there a way for Java to pause the print queue and then be
able to release particular print jobs?

cheers Dave
 
C

Chris Uppal

Is it possible to control a windows XP/2000 print queue using java?

No.

(And doing what you want, even in Windows-specific C++ code, would require deep
magic...)

-- chris
 
L

Lee Peedin

No.

(And doing what you want, even in Windows-specific C++ code, would require deep
magic...)

-- chris
Chris,
Monitoring the Windows print queue would in no way require "deep
magic"" C++ code. It can be done very easily with any scripting
language that supports ActiveX/OLE. Simpy create a WMI query that
monitors the print queue. This can be done in VBScript, ooRexx, etc.
And is probably directly available in Java using SWT since SWT
provides an ActiveX class.

I have dozens of applications that run unattended that create PDF
documents of client collected data. Upon completion, these documents
are emailed to the client. One can not assume that the PDF completion
is finished simply because the application has finished, so it becomes
necessary to monitor the print queue to determine when to specific
document has left the queue. In the OP's case, this "monitoring"
could also remove the document from the queue should the user decide
the "price is too high".

Since this is somewhat off-topic of this NG, anyone is welcomed to
email me directly for sample ooRexx code to monitor the print queue.

Lee
 
R

Roedy Green

Monitoring the Windows print queue would in no way require "deep
magic"" C++ code. It can be done very easily with any scripting
language that supports ActiveX/OLE. Simpy create a WMI query that
monitors the print queue. This can be done in VBScript, ooRexx, etc.
And is probably directly available in Java using SWT since SWT
provides an ActiveX class.

see http://mindprod.com/jgloss/com.html for various ways of doing COM
in Java. All are going to do the actual work in C/C++ via JNI.
 
C

Chris Uppal

Lee said:
Monitoring the Windows print queue would in no way require "deep
magic"" C++ code. It can be done very easily with any scripting
language that supports ActiveX/OLE. Simpy create a WMI query that
monitors the print queue.

I would call WMI fairly deep myself ;-) I don't think many people, except
advanced Windows system administrators, even know it exists. (I played with it
a bit a year or two back and found it very confusing -- the documentation is,
or was then, dire).

Anyway, is it possible to /intercept/ requests to the queue with WMI ? I had
assumed not[*], and without that ability I don't see how the OP can do what he
wants. (It's not enough to cancel the request if the user hits "no", but the
request has to be stopped until the user hits "yes".)

-- chris

[*] Or, to be more honest, I had forgotten about WMI entirely, but I /would/
have assumed that if I'd remembered ;-)
 
Joined
Apr 24, 2008
Messages
1
Reaction score
0
hi,

i am are doing a project on printers which requires me to collect info on the print jobs in the queue for each specific printer in the lan n/w... and also be able to delete or remove a print job from the queue....

can i do this using java.... ?if yes, then how shud i proceed with it,...
can somone help me with it.....
 
Joined
May 5, 2009
Messages
1
Reaction score
0
Java and JavaScript

Lee,

Thanks very much for this posting.. I need some more information like I wanted to write a java program which monitor the print queue by chance do you have any idea how to implement. is there any another way writing this with out WMI script.

Regards
Rao

Lee Peedin said:
On Sun, 9 Apr 2006 08:17:14 +0100, "Chris Uppal"
<[email protected]> wrote:

>[email protected] wrote:
>
>> Is it possible to control a windows XP/2000 print queue using java?

>
>No.
>
>(And doing what you want, even in Windows-specific C++ code, would require deep
>magic...)
>
> -- chris
>

Chris,
Monitoring the Windows print queue would in no way require "deep
magic"" C++ code. It can be done very easily with any scripting
language that supports ActiveX/OLE. Simpy create a WMI query that
monitors the print queue. This can be done in VBScript, ooRexx, etc.
And is probably directly available in Java using SWT since SWT
provides an ActiveX class.

I have dozens of applications that run unattended that create PDF
documents of client collected data. Upon completion, these documents
are emailed to the client. One can not assume that the PDF completion
is finished simply because the application has finished, so it becomes
necessary to monitor the print queue to determine when to specific
document has left the queue. In the OP's case, this "monitoring"
could also remove the document from the queue should the user decide
the "price is too high".

Since this is somewhat off-topic of this NG, anyone is welcomed to
email me directly for sample ooRexx code to monitor the print queue.

Lee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top