You can't do something like this. Not in JavaScript nor in any other programming languages (AFAIK). I think that's because the printer's driver is acting like a bridge between the application and the printer, so you cannot print a document without having the dialog box.
hth.
Download the new JavaScript Framework:
JUNE FrameworkSupport forum:
JUNE Forum