Giter Club home page Giter Club logo

Comments (7)

vraristizabal avatar vraristizabal commented on May 27, 2024 2

I think the issue is in the Network interface, it may be missing to resolve the promise?

networkConnection.write(buffer, null, () => {
            console.log(`Data sent to printer: ${name}`, buffer);
            if (!options.waitForResponse) {
              networkConnection.destroy();
              resolve();
            }
          });

from node-thermal-printer.

pierrepaz avatar pierrepaz commented on May 27, 2024

Same here, with Epson TM-T20X Ethernet, just if using promise, for sure.

from node-thermal-printer.

ggb88 avatar ggb88 commented on May 27, 2024

We are using epson TM88-VI - ethernet

from node-thermal-printer.

thomaslc08 avatar thomaslc08 commented on May 27, 2024

Same with TM 30 II

from node-thermal-printer.

Klemen1337 avatar Klemen1337 commented on May 27, 2024

The code bellow works fine for me. Please provice your code examples.

const { ThermalPrinter, PrinterTypes, CharacterSet, BreakLine } = require('node-thermal-printer')

async function example() {
  const printer = new ThermalPrinter({
    type: PrinterTypes.EPSON,
    interface: "tcp://192.168.1.87:9100",
    options: {
      timeout: 1000,
    },
    width: 48,
    characterSet: CharacterSet.SLOVENIA,
    breakLine: BreakLine.WORD,
    removeSpecialCharacters: false,
    lineCharacter: '-',
  });

  printer.println('Hello World!');
  printer.cut();

  try {
    await printer.execute();
    console.log('Print success.');
  } catch (error) {
    console.error('Print error:', error);
  }
}

example();

from node-thermal-printer.

treeindark avatar treeindark commented on May 27, 2024

did you plan to add the resolve ? (it work with it)

from node-thermal-printer.

Klemen1337 avatar Klemen1337 commented on May 27, 2024

The pull request was accepted and it will be applied in the new version

from node-thermal-printer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.