react-thermal-printer
Referencesreact-thermal-printercomponents

Printer

Interface of thermal printer.

Requires type to determine a printer type.

Currently, supports epson and start printers.

<Printer type="epson">...</Printer>
<Printer type="epson" width={42}>...</Printer>
<Printer type="epson" characterSet="korea">...</Printer>

With custom encoder

Pass encoder prop to use custom encoder.

// utf8 encoding
const encoder = text => new TextEncoder().encode(text);
const receipt = (
  <Printer type="epson" encoder={encoder}>
    ...
  </Printer>
);

Props

Prop

Type

Signature

function Printer(props: PrinterProps): JSX.Element;

On this page