I have tried using actionPrintImage and actionPrintText but none seems to work, on android and IOS both.
Your printer
Model Names: Star Micronics TSP650II
Interface: Bluetooth
OS: iOS, android
Code
actionPrintImage
var settings = new StarConnectionSettings();
settings.interfaceType = interfaceType;
identifier && (settings.identifier = identifier);
var printer = new StarPrinter(settings);
try {
const builder = new StarXpandCommand.StarXpandCommandBuilder();
builder.addDocument(
new StarXpandCommand.DocumentBuilder().addPrinter(
new StarXpandCommand.PrinterBuilder()
.actionPrintImage(
new StarXpandCommand.Printer.ImageParameter(
imageUri,
400,
),
)
.actionCut(StarXpandCommand.Printer.CutType.Partial),
),
);
const commands = await builder.getCommands();
await printer.open();
await printer.print(commands);
} catch (error) {
console.log(error);
} finally {
await printer.close();
await printer.dispose();
}
actionPrintText
var settings = new StarConnectionSettings();
settings.interfaceType = interfaceType;
identifier && (settings.identifier = identifier);
var printer = new StarPrinter(settings);
try {
const builder = new StarXpandCommand.StarXpandCommandBuilder();
builder.addDocument(
new StarXpandCommand.DocumentBuilder().addPrinter(
new StarXpandCommand.PrinterBuilder().actionPrintText(
'SKU Description Total\n' +
'300678566 PLAIN T-SHIRT 10.99\n' +
'300692003 BLACK DENIM 29.99\n' +
'300651148 BLUE DENIM 29.99\n' +
'300642980 STRIPED DRESS 49.99\n' +
'300638471 BLACK BOOTS 35.99\n' +
'\n' +
'Subtotal 156.95\n' +
'Tax 0.00\n' +
'--------------------------------\n',
),
),
);
const commands = await builder.getCommands();
await printer.open();
await printer.print(commands);
} catch (error) {
console.log(error);
} finally {
await printer.close();
await printer.dispose();
}
Additional context
I can successfully connect to the printer, but nothing is printed on the paper. Just a blank sheet of paper comes out of the printer.
Thanks in advance!
Description
I have tried using actionPrintImage and actionPrintText but none seems to work, on android and IOS both.
Your printer
Code
actionPrintImage
actionPrintText
Additional context
I can successfully connect to the printer, but nothing is printed on the paper. Just a blank sheet of paper comes out of the printer. Thanks in advance!