Skip to content

How to cut paper and the content after printing appears a P character #31

Description

@ngvcanh

Today, I installed this package and print success.

But I don't know how to cut paper after print?

And The content after printer appears a P character. My code:

const SerialPort = require('serialport');
const ThermalPrinter = require('thermalprinter');

function printSerial(){
  let serialPort = new SerialPort('COM2', { baudRate: 19200 });
  serialPort.on('open', function(){
      let printer = new ThermalPrinter(serialPort);
      printer.on('ready', function(){
        printer
        .printLine('Test')
        .printLine('Test')
        .printLine('Test')
        .printLine('Test')
        .printLine('Test')
        .printLine('Test')
        .print(function(){
          //printer.cut();
          console.log('done');
          //process.exit();
          serialPort.close();
        });
      });
    });
}

The content after print on paper:

PTest
Test
Test
Test
Test
Test

I'm using:

  • Electron: 11.1.1
  • serialport: 9.0.4
  • thermalprinter: 0.3.8

And from this package, may I print from template content?

Thank advance so much for support

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions