Developer Space / Intent Printer
Integration guide 3 of 7

Intent Printer Android โ†’ App

The fastest way to add printing to your Android app: send text, HTML, or images to Bluetooth Printer+ using a standard share Intent - the same mechanism you'd use to share to WhatsApp or Gmail.

What it is

Bluetooth Printer+ registers itself as a receiver for ACTION_SEND (and ACTION_SEND_MULTIPLE) intents. Any Android app - yours, or a user picking it from the system share sheet - can hand it text, HTML, or images and it opens, connects to the default printer, and prints. No pairing, account, or internet connection required; everything happens locally on the phone.

Content typeExtraBehavior
text/plainEXTRA_TEXTPrinted as-is (see markup syntax below)
text/htmlEXTRA_TEXTHTML tags are stripped down to formatted plain text - not styled (use text/plain + markup syntax for real bold/underline)
image/*EXTRA_STREAMPrinted as a dithered image
image/* (ACTION_SEND_MULTIPLE)EXTRA_STREAM (ArrayList)Each image printed in sequence

Examples

Plain text

val intent = Intent(Intent.ACTION_SEND).apply {
    setPackage("com.iyaltamizh.app.btprinter")
    type = "text/plain"
    putExtra(Intent.EXTRA_TEXT, "Hello from my app!\nOrder #A-1042 confirmed.")
}
startActivity(intent)

Omit setPackage(...) to show the normal Android share sheet instead of targeting Bluetooth Printer+ directly.

Rich text

For real bold/underline/alignment/QR output, send text/plain using the same lightweight markup Deep Link and JS Interface accept (**bold**, [center]/[right]/[small], [qr], an 8+ dash divider line) rather than text/html, since HTML formatting itself is flattened on print:

val intent = Intent(Intent.ACTION_SEND).apply {
    setPackage("com.iyaltamizh.app.btprinter")
    type = "text/plain"
    putExtra(Intent.EXTRA_TEXT,
        "[center]**MY STORE**[/center]\n" +
        "--------------------------------\n" +
        "2x Coffee            $7.00\n" +
        "--------------------------------\n" +
        "**Total: $7.00**")
}
startActivity(intent)

Placeholder

Content containing [[name]] or #[[name]] tokens is detected automatically when the app opens:

val intent = Intent(Intent.ACTION_SEND).apply {
    setPackage("com.iyaltamizh.app.btprinter")
    type = "text/plain"
    putExtra(Intent.EXTRA_TEXT,
        "Hello #[[customer]],\nYour table #[[table]] order is ready.")
}
startActivity(intent)
// The app prompts the user for "customer" and "table" before printing.
๐Ÿ“ธ Screenshot: the in-app placeholder input dialog prompting for a dynamic value before printing

Strict Mode Optional

By default, text/plain content prints as raw ESC/POS text using the printer's own built-in font. Add the boolean extra strict_mode to render it as a dithered image instead - pixel-for-pixel what a formatted on-screen template would look like, independent of whatever the phone's Settings screen has Strict Mode set to.

val intent = Intent(Intent.ACTION_SEND).apply {
    setPackage("com.iyaltamizh.app.btprinter")
    type = "text/plain"
    putExtra(Intent.EXTRA_TEXT, "[center]**MY STORE**[/center]\nThank you!")
    putExtra("strict_mode", true)
}
startActivity(intent)

Slower and heavier than normal text printing (it dithers and rasters an image instead of writing text bytes) - reach for it when formatting fidelity matters more than speed, not as the default for every job.

Limitations