Getnet DocsGetnet Docs

Print a Receipt

This guide shows how to print your own content — complementary receipts, coupons, and similar — on the terminal printer with printBitmap.

How it works

You send a Bitmap to the printer and receive status updates through a callback. This is for prints your application drives, outside the SDK’s automatic sale receipts.

Before you begin

The SDK must have completed warm-up with WarmUpStatus.Success, and the terminal printer must be available.

ApoloSdk.getClient().printBitmap(bitmap) { status ->
    when (status) {
        GetPrinterUseCaseState.OnIdle,
        GetPrinterUseCaseState.OnPrinting -> { /* printing in progress */ }
        GetPrinterUseCaseState.OnSuccess -> { /* print completed */ }
        is GetPrinterUseCaseState.OnError -> { /* status identifies the cause */ }
    }
}

Printer status

The callback reports each transition:

StateMeaning
OnIdleInitial preparation of the print.
OnPrintingPrint in progress.
OnSuccessPrint completed successfully.
OnError(status)The print failed. status is a PosDigitalPrinterStatusEnum, such as NO_PAPER, PAPER_JAM, OVERHEAT, or LIFT_HEAD.

Best practices

  • Prepare the Bitmap at a resolution compatible with the terminal printer. Oversized or low-contrast images degrade the result.
  • Wait for OnSuccess or OnError before starting another print.

Next steps