1.0.2 • Published 5 years ago

png-to-zebra v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

PNG to Zebra KR203 Printer

Reads a PNG and outputs a stream of printer commands for the Zebra KR203

Usage

KR203 Kiosk printer doesn't support the label printer protocols provided by CUP. This will use as RAW device.

  const printer = require('png-to-zebra')
  const gm = require('gm').subClass({ imageMagick: true })

    gm(buffer)
      .resize(640)
      .density(300)
      .threshold('50%')
      .flatten()
      .toBuffer('PNG'
        , function (err, buffer) {
        if (err) console.log(err)
        printer(buffer)
      })