Skip to content
Back to Billfinch

Print from a web POS with Billfinch

Billfinch is a free Android app that prints to ESC/POS thermal receipt printers (Bluetooth, Wi-Fi port 9100, USB). Your web app can print through it by opening a billfinch://print link. The receipt prints at once on the printer the user set up in Billfinch, then the phone returns to your page. The first time, Billfinch asks the user to allow web pages to print.

One line of JavaScript

Plain text

location.href = 'intent://print?text=' + encodeURIComponent(text) + '#Intent;scheme=billfinch;package=com.tinyfair.billfinch;end';

Simple HTML

location.href = 'billfinch://print?html=' + encodeURIComponent('<center><h1>My Shop</h1></center>Coffee 2 x 3.00<br><b>TOTAL 6.00</b>');

Picture (receipt image)

location.href = 'billfinch://print?image=' + encodeURIComponent(canvas.toDataURL('image/png'));

Raw ESC/POS bytes

location.href = 'billfinch://print?escpos=' + btoa(String.fromCharCode(...bytes));

Parameters

text
Plain text, URL-encoded. New lines are kept. Printed as a picture, so any language works.
html
Simple HTML: <p>, <br>, <b>, <h1>, <h2>, <center>, text-align:center, <hr>, tables (cells joined by spaces). Scripts and styles are ignored.
image
A PNG or JPEG as base64 or a data URL. It is fitted to the paper width (384 dots for 58 mm, 576 for 80 mm).
url
An https:// address of a PNG or JPEG to download and print.
escpos
Raw ESC/POS bytes, base64 (standard or URL-safe, padding optional). Sent to the printer as they are.
copies
1 to 5. Default 1.

Notes

  • Use the intent:// form in Chrome on Android; it also sends users to Google Play if Billfinch is not installed.
  • Keep links under about 1 MB. For long receipts prefer image or escpos.
  • Billfinch only uses its own billfinch: scheme.
  • Other apps can also print through the Android print menu: users choose "Billfinch thermal printer".

Questions: support@tinyfair.my.id.