Skip to content

Property 'id' does not exist on type 'Printer'. #58

@compassbelgium

Description

@compassbelgium

printTicket(ticket:string) {
this.thermalPrinter.listPrinters({type: 'usb'}, (printers) => {
if (printers.length > 0) {
var ptr = printers[0];
this.thermalPrinter.printFormattedText({
type: 'usb',
id: ptr.id,
text: ticket // new lines with "\n"
}, function() {
console.log('Successfully printed!');
}, function(error) {
console.error('Printing error', error);
});
} else {
console.error('No printers found!');
}
}, function(error) {
console.error('Ups, we cant list the printers!', error);
});
}

ionic version 7.2.0
capacitor version 5.5.1
angular version 17.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions