NetTalk Central

Author Topic: Force print from browser  (Read 3949 times)

ozejohn

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
    • Email
Force print from browser
« on: September 24, 2008, 03:09:11 PM »
Hi,

I need to make the browser print a file directly to a printer on the client from a nettalk web server app. When some workflows are completed a text file needs to print automaticaly to a particular printer on the local network. I can get this to happen with a print button. But I can't see how to automate it so it always happens without the user having to click any extra buttons.

This is really a browser question but if anyone can point me in the right direction I would greatly appreciate the help.

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Force print from browser
« Reply #1 on: September 24, 2008, 03:16:24 PM »
It should be relatively easy to do with Javascript. It would be something like:

<body onload="javascript:window.print()">

What I don't know is whether you need it automated, and if you could do it without opening up a print dialog.
Mike Grigsby
Credify Systems
Central Oregon, USA

ozejohn

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
    • Email
Re: Force print from browser
« Reply #2 on: September 24, 2008, 05:05:00 PM »
Mike,

I need it to be automatic with no ok button and no printer target selection. We also need to print different reports to different printers.

Thanks for the suggestion. I will start looking into javascript options.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Force print from browser
« Reply #3 on: September 24, 2008, 09:55:20 PM »
Hi John,

I'm not sure if this is possible. There was a thread recently about printing automatically, with a number of copies, and from my research then it seemed you can't bypass the printer dialog. If you do find anything though please let us know.

Remember it's the browser which pops up the dialog, not the page itself.

If it's an internal app then one option is to compile a custom browser, based say on the FireFox code, but that sounds like an extreme approach to me.

Cheers
Bruce