Add print on Zebra
parent
125df83f99
commit
6eb8e4323b
|
@ -1075,6 +1075,18 @@ function file_save(maybe_saved_callback = () => { }, update_from_saved = true) {
|
|||
});
|
||||
}
|
||||
|
||||
function print_zebra() {
|
||||
write_image_file(main_canvas, 'image/png', (blob) => {
|
||||
console.log(blob)
|
||||
fetch(`print?printer=zebra`, {
|
||||
method: 'POST',
|
||||
body: blob,
|
||||
}).then(response => {
|
||||
console.log({response})
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function file_save_as(maybe_saved_callback = () => { }, update_from_saved = true) {
|
||||
deselect();
|
||||
systemHooks.showSaveFileDialog({
|
||||
|
|
10
src/menus.js
10
src/menus.js
|
@ -232,6 +232,16 @@
|
|||
description: localize("Quits Paint."),
|
||||
}
|
||||
],
|
||||
[localize("HSWAW")]: [
|
||||
{
|
||||
item: localize("Print on Zebra (large label)"),
|
||||
speech_recognition: [],
|
||||
action: () => {
|
||||
print_zebra()
|
||||
},
|
||||
description: '',
|
||||
},
|
||||
],
|
||||
[localize("&Edit")]: [
|
||||
{
|
||||
item: localize("&Undo"),
|
||||
|
|
Loading…
Reference in New Issue