Phygrid Developers
Browse Topics
@ombori/ga-thermal-printer / Phygrid Developers

@ombori/ga-thermal-printer

Example:

import createPrinter from "@ombori/ga-thermal-printer"

export default function printTicket(ticket: string) {
  if (printer) {
    printer.alignCenter()
    printer.setTextQuadArea()
    printer.bold(true)
    printer.newLine()
    printer.setTextSize(4, 4)
    printer.println(ticket)
    printer.partialCut()
    return printer.execute()
  } else {
    throw new Error("Error printing ticket")
  }
}

© 2024 · Phygrid. An Ombori company