How can an XWT application print documents on a printer?
Use xwt.newBrowserWindow() to spawn a web browser. The URL passed to this function should be a server-side script that dynamically generates the document required, either as HTML, or as an embedded PDF document. The enclosing HTML document should include the javascript window.print(), which will display the browser’s print dialog. This affords the user single-click print access, with the browser acting as a “print preview”. Providing unrestricted access to the user’s printer would be a security risk — imagine an untrusted XWT app secretly starting a print job consisting of 10,000 pages of solid black. If the printer is in another room, the user wouldn’t know what had happened until the printer’s toner cartridge and paper tray had been completely emptied.