Skip to main content
Known Participant
April 12, 2009
Question

How to specify a printer?

  • April 12, 2009
  • 3 replies
  • 2057 views

I have a coldfusion application that's used by a collection of users who are all using the same type of label printer.

One thing the app does is use cfdocument to generate a pdf sized for this label printer.  It also generates a series of forms that are printed on a regular printer - these vary, and are the default printer on each client's machine.

Here's what I need to know - when the label is generated, they press the print button and the print dialogue opens, how can I make the label printer (not the default printer) the printer that's selected?  So all users have to do is click "print" --> "ok" and the page prints, without needing to choose a printer.

Like I said, I know the exact printer all my users are using.

I know this can be done as one of my users sent me screen capture of another web app doing this.  I didn't catch which scripting language they were using but will try to find out.

So, obviously this is possible with some combination of web scripting / javascript / vbscript / something.  Can anyone offer ANY ideas?  I don't even mind if it's a browser-specific solution in this case.

Thanks much,

Joe

    This topic has been closed for replies.

    3 replies

    Known Participant
    April 14, 2009

    Fair enough.  Thanks everyone for the replies.  The more I look at this, the more I think this other web app is installing something on client's machines.  I'm not going down that road, so I'll just stick with having clients choose the printer.

    Thanks again...

    Joe

    tclaremont
    Inspiring
    April 13, 2009

    I can only guess that the only apps you have seen do this are written in a client-side language. That is why the application would have knowlege of the local computer's printer avilablities.

    It does not take long to imagine the security issues that would arise if a web application were allowed to print directly to the end users printer unencumbered. You think spam in your email is bad? What if the spammer sent the ad directly to your printer? What if it were that simple to get access to your other network resources, not just your printers?

    So, if you have to defend this interpretted weakness, you can most certainly make it evident to the customer WHY the ability for the web application to print directly to the printer is a can of worms. Having them manually choose a printer is safer, even it it is not always "better".

    Inspiring
    April 12, 2009

    cfprint

    Known Participant
    April 13, 2009

    Thanks Dan...  I looked at that, but according to the Livedocs it's for server-side printing.  I'm looking for client-side printing.  Every user of my application has their OWN printer hooked to their OWN computer in their own place of business... they're just all using exactly the same type of printer.

    Can cfprint help in this situation?

    tclaremont
    Inspiring
    April 13, 2009

    Keep in mind that CF is a server-side language. Therefore the "local" printer is whatever printer is set up as the default ON THE SERVER, not on the client.

    What you can do is initiate the operating system's print functions using java script. This will not automatically print to the local machine, but will bring up the dialog box, allowing the end user to ensure that the correct printer is selected.