Skip to content

Commit 87e3749

Browse files
committed
Fix multiple zpl labels
1 parent eea6768 commit 87e3749

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ZplEscPrinter/js/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ async function zpl(data){
126126
continue;
127127
}
128128

129-
zpl += '^XZ';
129+
zpl = zpl.replace(/^\s+/, '') + '^XZ';
130130

131131
let api_url = atob('aHR0cDovL2FwaS5sYWJlbGFyeS5jb20vdjEvcHJpbnRlcnMvezB9ZHBtbS9sYWJlbHMvezF9eHsyfS8wLw==')
132132
.format(configs.density, width>15.0 ? 15 : width, height);
133133
let blob = await displayZplImage(api_url, zpl, width, height);
134134

135135
if (![1, '1', true, 'true'].includes(configs.saveLabels)) {
136-
return;
136+
continue;
137137
}
138138

139139
console.info("configs", configs.saveLabels, "fileType", configs.filetype);

0 commit comments

Comments
 (0)