Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can an XWT application print documents on a printer?

0
10 Posted

How can an XWT application print documents on a printer?

0
10

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.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123