react-thermal-printer
Referencesreact-thermal-printercomponents

Image

Print image bitmap.

<Image src="https://my-cdn.com/image.png" />
<Image align="center" src="https://my-cdn.com/image.png" />
<Image src="https://my-cdn.com/image.png" reader={myCustomImageReader} />

// A custom reader for reading image binary data.
function myCustomImageReader(
  elem: ReactElement<ComponentProps<typeof Image>>
): Promise<Image>;

By passing transform functions, image can be converted.

The example below applies the Floyd-Steinberg dithering algorithm:

import { transforms } from '@react-thermal-printer/image';

<Image src="https://my-cdn.com/image.png" transforms={[transforms.floydSteinberg]} />

Props

Prop

Type

Signature

function Image(props: ImageProps): JSX.Element;

On this page