KioskSimple

How to Print in JavaScript Without Displaying the Print Dialog Box

How to Print in JavaScript Without Displaying the Print Dialog Box

A common request we’ve heard is how to print from the web browser in JavaScript without first displaying the printer dialog box.  I’m going to show you how this is possible using KioskSimple kiosk software.

When it’s time for your kiosk to print a ticket, receipt, label, etc… the last thing you want is for the user to be prompted by the print dialog.

For security reasons your browser requires that you’re prompted by the print dialog box before printing, otherwise any webpage could start using your printer without your permission.  Just imagine how annoying it would be if you visited a website and your printer suddenly started spitting out a mountain of paper.

While this security restriction makes sense in your typical web browser, it doesn’t make sense in a self-service kiosk environment.  This is because on your kiosk you have total control over the content displayed to users and often have created the web pages yourself, so you know they can be trusted to use the printer appropriately.

This is why we made it easy to print without displaying the print dialog box from KioskSimple WITHOUT ANY MODIFICATION TO YOU WEBSITE.

How to Print in JavaScript Without Displaying the Print Dialog Box

Simply assign the desired printer as the default printer in Windows and make sure you’re using the Chrome Engine under the browser settings (the default setting).

Then call window.print(); and that’s it!

No code modifications to your website are required.

Got Questions?

Please contact us and we’ll get you in touch with a developer.  We offer free phone and email technical support for all of our code examples.  Try finding that anywhere else in this industry.

We’re dedicated to making your next kiosk project a success and we’re happy to hold your hand through the hardware integration.