switch(params.print_strategy || obj.data.print_strategy) {
case 'dos.print':
+ if (typeof w != 'string') {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ w.getSelection().selectAllChildren(w.document.firstChild);
+ w = w.getSelection().toString();
+ }
obj._NSPrint_dos_print(w,silent,params);
break;
case 'window.print':
the html window handle our receipt template rendering, and then force a selection of all
the text nodes and dump that to a file, for printing through a dos utility */
- /*
- netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- w.getSelection().selectAllChildren(w.document.firstChild);
- var text = w.getSelection().toString();
- */
-
/* NEW way: we just pass in the text */
var text = w;
file.close();
file = new util.file('receipt.bat');
- file.write_content('truncate+exec','#!/bin/sh\ncopy ' + path + ' lpt1 /b\nlpr ' + path + '\n');
+ file.write_content('truncate+exec','#!/bin/sh\ncopy "' + path + '" lpt1 /b\nlpr ' + path + '\n');
file.close();
file = new util.file('receipt.bat');