What I’m looking for is a device which consists of a smartphone-like interface and a small printer.

The smartphone part should provide

  • a capacitive touch screen
  • a HTML5-capable browser
  • network connectivity (3G/4G, Wifi, etc.)
  • enough CPU power, RAM etc. for running a rather complex web application

The printer could be some 2.5 inch thermo-transfer or similar technology.

The browser should allow printing from a browser application, for example it could expose an additional JavaScript API for talking to the printer, something like:

window.Printer = 
    getLineWidth : function() {}, // returns the letters fitting a row

    getPixelWidth : function() {}, // returns the number pixels in a row

    printLine : function(text) {}, // prints a text, then CR/LF

    printImage : function(blob) {} // prints an image in a given format

Or, ideally, it would print web pages with print stylesheets.

The device should be portable, meaning it should be able to run on or charge via USB, and it shouldn’t be too heavy.

Does something like this exist? Does anybody have experience in regard to quality, reliability, spare parts and paper availability? How does it work in practice?

Alternatively: Is there a portable printer for Android which registers as a local printing service and prints browser contents formatted by HTML5 print stylesheets?

(NOTE: What we currently have is a USB thermo printer and a web app running in WebView with a JS API similar to the example above … but we want to get rid of it and have an integrated, purely web-based solution.)

  • No existing browser that I know of - and certainly no security-conscious browser - exposes any more of a JS print API than a single "print this page" method. You'd need to write a custom browser. – ArtOfCode Nov 14 '16 at 23:00
  • I agree, security is an issue. But it could be implemented like the Geolocation APIs, i.e. display a dialog before allowing access. Re: “You'd need to write a custom browser”: As I said, this is what we currently have – a WebView extended with a proprietary JavaScript API which talks to the printer’s internal Java API. Works, but requires installation of an app (only to run a web application) – not so beautiful. – lxg Nov 14 '16 at 23:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.