CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  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 http://www.xyz.com and Doc b is on http://www.abc.com.

    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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.