Select your printer model

Parameters are refined by the selected printer.

print method


Prints image data drawn in HTML5 Canvas.

Converts the specified area of an HTML5 Canvas RGBA full-color image into raster data according to halftone property and brightness property setting. One pixel of an image corresponds to one dot of the printer. When a transparent color is contained in the image, the background of the image is assumed to be white.

Prints on a receipt without regard to the paperType property setting. The execution result of the print method is passed to the callback function of onreceive event.

Syntax

 
print(canvas,cut,mode,timeout);

Parameter

canvas

Value

Description

canvas

Specifies an HTML5 Canvas object.

cut

Value

Description

true

Uses the automatic cutting function.

false

Does not use the automatic cutting function.

undefined

Does not use the automatic cutting function.

mode

Value

Description

MODE_MONO

Monochrome (2 scales)

MODE_GRAY16

Multi-gradation (16 scales)

undefined

Monochrome (2 scales)

timeout

When an invalid value is specified, the default value will be used.

Value

Description

Integer from 1 to 1000000

Specifies the timeout period before completion of printing in milliseconds.

undefined

Specifies the default value (60000).

Supplementary explanation

  • HTML5 Canvas data containing image data downloaded from different domains cannot be printed. A security error occurs due to the Same-Origin policy of JavaScript.
  • Multi-gradation printing can be used in the standard mode but not in the page mode.
 

Quick Access

  • [Name]
  • [Format]
  • [Range]
  • [Description]
  • [Notes]

Epson ePOS SDK includes patented or patent pending functions. The contents must not be disclosed to third parties.


Epson ePOS SDK for JavaScript

Jump to the top