Printer

SDK & Device APIs / Printer

Owner: SDK team · Reviewed 12 Oct 2026

Printer

Print receipts, text and QR codes on the terminal’s built-in printer. Follow the steps in order: each one explains a single call and shows only the few lines you need.

1  Initialise the printer

Get the printer service and check that it is ready before sending anything to print.

Only the call explained in this step

Printer printer = NewlandSdk.getPrinter(context);
printer.init();

Ask about this step →

2  Print text and a QR code

Add the lines of text and the QR code to the print job, then send it. Text alignment and size are set per line.

Only the call explained in this step

printer.addText("Thank you!", Align.CENTER);
printer.addQrCode(receiptUrl, 240);
printer.print();

Ask about this step →

3  Cut the paper and release

Feed and cut the paper when the job is finished, and release the printer so other apps can use it.

Only the call explained in this step

printer.feedAndCut();
printer.release();

Ask about this step →

4  Handle errors (paper out, overheating)

Listen for printer status errors and show a clear message to the operator. The most common are paper out and overheating.

Only the call explained in this step

printer.setOnErrorListener(error -> {
  if (error == PrinterError.PAPER_OUT) showPaperOutMessage();
});

Ask about this step →

Toolkit — stays in view while you scroll

Install

implementation "pt.newnote:newland-sdk:3.4.0"

Full setup: Getting Started → Preparing the environment

🔒 Required permissions

  • Printer access
  • Device information (terminal model)

Download resources