I am writing a web-based system with java. There are some labels and reports printing. Each requires different printers which are connected to the same client computer.

How could I set so that, when clicked "Print Doc A", document A would print to printer A, and when clicked "Print Doc B", document B would print to printer B.

Both the documents have different url. Doc A has http://www.xyz.com and Doc B has http://www.abc.com

If this is not possible in Java, is it possible same way? with activex script or any thing?

info: It is a web-based system used within a lan. So each user use the system with a fixed computer.