Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PC860_PORTUGUESE not function in words using ~ #226

Open
LuWroblewski opened this issue May 31, 2023 · 2 comments
Open

PC860_PORTUGUESE not function in words using ~ #226

LuWroblewski opened this issue May 31, 2023 · 2 comments

Comments

@LuWroblewski
Copy link

LuWroblewski commented May 31, 2023

This characterSet not function in words using ~

Example: Feijão or balão

In printer showing feij,,o bal,,o

my code:

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

async function example() {
    const printer = new ThermalPrinter({
        type: PrinterTypes.EPSON, 
        interface: 'printer:POS58 Printer',
        driver: require("@thiagoelg/node-printer"),
        options: {
          timeout: 1000,
        },
        width: 48, 
        characterSet: 'PC860_PORTUGUESE', 
        breakLine: 'WORD', 
        removeSpecialCharacters: false, 
        lineCharacter: '-', 
      });

  const isConnected = await printer.isPrinterConnected();
  console.log('Printer connected:', isConnected);

  printer.alignCenter();
  printer.newLine();
  printer.println('feijão ');

  printer.cut();
  printer.openCashDrawer();

  console.log(printer.getText());

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

example();
@Klemen1337
Copy link
Owner

Some printers might not have support for this character set. I tested your code on my epson RP326 and it works.

@Rafatcb
Copy link
Contributor

Rafatcb commented Oct 5, 2023

This is probably printer specific. CharacterSet.WPC1252 worked best for me on a Daruma DR 800, although CharacterSet.WPC1252 and CharacterSet.PC860_PORTUGUESE worked as expected on a Diebold TSP143MD and a Tanca TP 650.

My test included:

printer.println('áàãä éèë íìï óòö úùü !@#$%¨&*()?|"\'');
printer.println('ÀÁÃÄ ÉÈË ÍÌÏ ÓÒÖ ÚÙÜ =+-/\\;:,.~][');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants