Awaken Print
For developers

One-tap receipt printing for your web app

Let your users print receipts on a Bluetooth thermal printer with one tap: no print preview, no choosing a printer. It works in Chrome on Android with the free Awaken Print app. Add one script to your receipt page and change one button.

Everywhere else (a PC, an iPhone, or an Android phone without the app) your page keeps printing exactly as it does today.

What your users need

  1. An Android phone or tablet with Chrome.
  2. The Awaken Print app from Google Play (coming soon).
  3. A Bluetooth thermal receipt printer (58 mm or 80 mm, ESC/POS), chosen once in the app.

Add it in 3 steps

1. Load the script on the page that shows the receipt

<script src="https://print.awakendev.com/1/pos-printer.js"></script>

2. Prepare the receipt when the page has loaded

On a slow phone, drawing the receipt takes a second or two. Doing it early makes the tap instant.

var receipt = document.getElementById('receipt');
if (window.PosPrinter) PosPrinter.prepare(receipt);

3. Print on tap

document.getElementById('printBtn').onclick = function () {
  if (window.PosPrinter) PosPrinter.print(receipt);
  else window.print();
};

That's all. PosPrinter.print sends the receipt to Awaken Print when it can, and calls window.print() when it can't.

Full example

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <script src="https://print.awakendev.com/1/pos-printer.js"></script>
  <style>
    #receipt { width: 48mm; font-family: sans-serif; font-size: 12px; color: #000; }
    #receipt .row { display: flex; justify-content: space-between; }
    #receipt h1 { font-size: 16px; text-align: center; margin: 0 0 4px; }
  </style>
</head>
<body>
  <div id="receipt">
    <h1>My Shop</h1>
    <div class="row"><span>Tea x2</span><span>200.00</span></div>
    <div class="row"><span>Bun x1</span><span>80.00</span></div>
    <div class="row"><b>Total</b><b>280.00</b></div>
    <p style="text-align:center">Thank you!</p>
    <button class="no-print" onclick="location.href='/'">Back</button>
  </div>

  <button id="printBtn">Print</button>

  <script>
    var receipt = document.getElementById('receipt');
    if (window.PosPrinter) PosPrinter.prepare(receipt);
    document.getElementById('printBtn').onclick = function () {
      if (window.PosPrinter) PosPrinter.print(receipt);
      else window.print();
    };
  </script>
</body>
</html>

Try it on a phone first: open print.awakendev.com/demo in Chrome on an Android phone with Awaken Print installed.

Pin the script (recommended)

To be sure the file you load is the one we published, add its hash:

<script src="https://print.awakendev.com/1/pos-printer.js"
        integrity="sha256-UAuhMqSs6gBSzvrj27SiJGOVCQvjpFhVlnarDoRIJ0s="
        crossorigin="anonymous"></script>

When we publish a fix, the hash changes and we list the new one under Changes. If the hash doesn't match, the browser won't run the script, and your page falls back to window.print(). That's why the examples check window.PosPrinter. You can also keep a copy of the file on your own server and load it from there.

What happens on each device

DeviceWhat the tap does
Android + Chrome + Awaken PrintPrints straight away
Android without Awaken PrintChrome comes back to your page and opens the normal print dialog. The script remembers this for a day, so it doesn't try the app on every tap.
PC, Mac, iPhoneThe normal print dialog (window.print())

Your page never needs to know which one happened. If you want to know, print() returns a promise that gives 'app' or 'fallback'.

Designing the receipt

The script takes a picture of your receipt element and prints it dot for dot, so what you see is what prints.

Options

Pass them as the second argument to prepare and print, and use the same ones for both:

PosPrinter.print(receipt, { hide: '.no-print, .ad', threshold: 160 });
OptionDefaultWhat it does
hide'.no-print'CSS selector for elements left out of the print
monochrometrueForces black text and no backgrounds
threshold1700–255. Lower makes the print lighter, higher makes it darker.
padding'2mm 1.5mm'Space around the receipt
fallbackwindow.printWhat to call when the app can't be used, e.g. your own print preview
CallReturns / does
PosPrinter.status()'ready', 'app-missing', 'not-android', 'unsupported' (very old Chrome) or 'disabled'
PosPrinter.disable()Stop using the app on this device (for a setting in your app)
PosPrinter.enable()Use it again, and forget the "app missing" memory

What it costs your users

Privacy

The receipt goes from the page to the app on the phone, and from the app to the printer over Bluetooth. Nothing is sent to us or to any server. The script only reads your page's own fonts and images to draw the receipt, and doesn't track anyone.

Not a website?

If you make a native Android app, you can open the same link Awaken Print understands. You draw the receipt as 1-bit rows yourself. Email us and we'll send the link format.

Versions

Changes

DateChangeHash
2026-10-21First public release of /1/pos-printer.jssha256-UAuhMqSs6gBSzvrj27SiJGOVCQvjpFhVlnarDoRIJ0s=

Help

Questions, or something prints wrong? Email [email protected] with your page's address and a photo of the receipt.