Web API print

This commit is contained in:
Eden Kirin
2023-08-02 11:04:00 +02:00
parent 87b17e3745
commit 7be2dc2466
3 changed files with 74 additions and 58 deletions

View File

@ -169,29 +169,3 @@ async function createInternalStickerZPL(options) {
...options,
});
}
function getAvailablePrinters() {
return new Promise((resolve, reject) => {
const devices = [];
BrowserPrint.getDefaultDevice("printer", device => {
devices.push(device);
const defaultDevice = device;
BrowserPrint.getLocalDevices(deviceList => {
//console.log(deviceList)
deviceList.printer.forEach(device => {
if (!defaultDevice || device.uid != defaultDevice.uid) {
devices.push(device);
}
}, error => {
reject("Error getting local devices");
}, "printer");
resolve(devices);
});
}, error => {
reject(error);
})
})
}