Subscribe Getting started with chrome.printing API
Send a print job
Task 4
20 minutes
In the previous step, you created a button for each printer within the printers table. Now, you need to add a function in printers.js to handle print button click events.
When submitting a print job, a dialog box will ask the user to confirm printing. In some cases, you will want to bypass this dialog box (e.g. users cannot confirm a dialog on a self-service Kiosk machine).
Bypassing the dialog box confirmation requires that the ChromeOS device be a managed device. Further, you must configure the PrintingAPIExtensionsAllowList policy in Google Enterprise Admin Console.
Note: We are using a pre-generated PDF file to print a receipt. To print to a regular paper size, you can replace the media_size with another option exposed in the printer capabilities: