/** On "Print" clicked */ printButton.onclick = async () => { /** left or top */ constprintDirection = "left"; constquantity = 1;
/** Convert image to black and white bits */ constencoded = ImageEncoder.encodeCanvas(canvas, printDirection);
/** todo: Auto-detection works only for a small set of printers so manual user selection is required */ constprintTaskName = client.getPrintTaskType() ?? "D110";
Example