Skip to main content

Interface: AddImageParams

source​

source: ImageSource The image source (either a remote URL or a local file resource).

ValueDescription
{ uri: base64String }Base64 string image
{ uri: 'https://...' }Remote image
{ uri: 'http://...' }Remote image
{ uri: 'file://...' }Local image
require('./path_to_local_image/image.png')Local image

width​

width: number

Specifies the width of the print area (in pixels).

ValueDescription
Integer from 1 to 65535Width of the print area (in pixels)

color (optional)​

color?: number

Specifies the color.

ValueDescription
PrinterConstants.COLOR_NONENo printing
PrinterConstants.COLOR_1First color
PrinterConstants.COLOR_2Second color
PrinterConstants.COLOR_3Third color
PrinterConstants.COLOR_4Fourth color
PrinterConstants.PARAM_DEFAULTSpecifies the default value (first color).

mode (optional)​

mode?: number

Specifies the color mode.

ValueDescription
PrinterConstants.MODE_MONOMonochrome
PrinterConstants.MODE_GRAY1616-level grayscale
PrinterConstants.MODE_MONO_HIGH_DENSITYHigh-density monochrome
PrinterConstants.PARAM_DEFAULTSpecifies the default value (monochrome).

brightness (optional)​

brightness?: number

Specifies the brightness compensation value.

ValueDescription
Float from 0.1 to 10Brightness compensation value
PrinterConstants.PARAM_DEFAULTSpecifies the default value (1.0).

compress (optional)​

compress?: number

Enables or disables compression. Compressing print images can prevent white banding or streaks from occurring on printed images. This works well when connecting with the printer using Bluetooth.

ValueDescription
PrinterConstants.COMPRESS_DEFLATECompresses the image.
PrinterConstants.COMPRESS_NONEDoes not compress the image.
PrinterConstants.COMPRESS_AUTOAutomatically compresses the image.
PrinterConstants.PARAM_DEFAULTSpecifies the default value (compression is automatically determined).

halftone (optional)​

halftone?: number

Specifies the halftone processing method.

ValueDescription
PrinterConstants.HALFTONE_DITHERDithering (appropriate for printing graphics only)
PrinterConstants.HALFTONE_ERROR_DIFFUSIONError diffusion (appropriate for printing text and graphics)
PrinterConstants.HALFTONE_THRESHOLDThreshold (appropriate for printing text only)
PrinterConstants.PARAM_DEFAULTSpecifies the default value (dithering).

Effective for the monochrome (2 scales) color mode only.