How to Select different Printer for different document?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: How to Select different Printer for different document?

  1. #1
    Join Date
    Aug 2009

    How to Select different Printer for different document?

    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 I "Print Doc A", document A would print to printer A, and "Print Doc B" button, document B would print to printer B.

    The URL for both documents are different. Doc A is on and Doc b is on

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

  2. #2
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999

    Re: How to Select different Printer for different document?

    You can get an array of the visible printers via PrintServiceLookup. Then you can set the selected printer for the print job:
    PrintService[] printServices=PrintServiceLookup.lookupPrintServices(null, null);
    ... // select print service
    If the code is running on the server and the printers are strictly local to the client (not visible to the server), I guess you'd have to let the client choose via their browser.

    If you're not failing every now and again, it's a sign you're not doing anything very innovative...
    W. Allen
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Azure Activities Information Page

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


HTML5 Development Center