configurable tcp bufferSize, pdf fixes, v1.6
This commit is contained in:
parent
c30c0eabfc
commit
3404824de1
@ -8,9 +8,13 @@ Printer emulator for zpl rendering engine. The emulator is based on the [labelar
|
|||||||
|
|
||||||
## Release notes
|
## Release notes
|
||||||
|
|
||||||
|
### Version 1.6
|
||||||
|
* **Fix** PDF label export.
|
||||||
|
* **New** TCP input buffer size can be configure in settings.
|
||||||
|
|
||||||
### Version 1.5
|
### Version 1.5
|
||||||
|
|
||||||
* **New** Support to print multtiple labels in one request.
|
* **New** Support to print multiple labels in one request.
|
||||||
* **New** Optional setting to keep tcp connection alive.
|
* **New** Optional setting to keep tcp connection alive.
|
||||||
|
|
||||||
### Version 1.4.1
|
### Version 1.4.1
|
||||||
|
|||||||
BIN
ZplPrinter.zip
BIN
ZplPrinter.zip
Binary file not shown.
@ -19,6 +19,7 @@ chrome.runtime.onInstalled.addListener(function (details) {
|
|||||||
unit: '1',
|
unit: '1',
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
port: '9100',
|
port: '9100',
|
||||||
|
bufferSize: '4096',
|
||||||
keepTcpSocket: false,
|
keepTcpSocket: false,
|
||||||
saveLabels: false,
|
saveLabels: false,
|
||||||
filetype: '1',
|
filetype: '1',
|
||||||
|
|||||||
@ -28,9 +28,16 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
for (var i in zpls) {
|
for (var i in zpls) {
|
||||||
var zpl = zpls[i];
|
var zpl = zpls[i];
|
||||||
if (zpl != "") {
|
if(!(!zpl || !zpl.length)) {
|
||||||
zpl = zpl + "^XZ";
|
zpl += "^XZ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (configs['saveLabels']) {
|
||||||
|
if (configs['filetype'] == '2') {
|
||||||
|
savePdf(zpl, configs.density, width, height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open('POST', 'http://api.labelary.com/v1/printers/{0}dpmm/labels/{1}x{2}/0/'.format(configs.density, width, height), true);
|
xhr.open('POST', 'http://api.labelary.com/v1/printers/{0}dpmm/labels/{1}x{2}/0/'.format(configs.density, width, height), true);
|
||||||
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||||
@ -41,8 +48,6 @@ $(document).ready(function () {
|
|||||||
if (configs['saveLabels']) {
|
if (configs['saveLabels']) {
|
||||||
if (configs['filetype'] == '1') {
|
if (configs['filetype'] == '1') {
|
||||||
saveLabel(blob, 'png');
|
saveLabel(blob, 'png');
|
||||||
} else {
|
|
||||||
savePdf(zpl, configs.density, width, height);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var size = getSize(width, height)
|
var size = getSize(width, height)
|
||||||
@ -150,7 +155,9 @@ function startTcpServer() {
|
|||||||
chrome.sockets.tcpServer.onAccept.addListener(function (clientInfo) {
|
chrome.sockets.tcpServer.onAccept.addListener(function (clientInfo) {
|
||||||
chrome.sockets.tcp.getInfo(clientInfo.clientSocketId, function (socketInfo) {
|
chrome.sockets.tcp.getInfo(clientInfo.clientSocketId, function (socketInfo) {
|
||||||
clientSocketInfo = socketInfo;
|
clientSocketInfo = socketInfo;
|
||||||
chrome.sockets.tcp.setPaused(clientInfo.clientSocketId, false);
|
chrome.sockets.tcp.update(clientInfo.clientSocketId,{bufferSize: parseInt(configs.bufferSize) }, function(){
|
||||||
|
chrome.sockets.tcp.setPaused(clientInfo.clientSocketId, false);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -133,6 +133,13 @@
|
|||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
<div class="input-group" style="padding-right: 10px;">
|
||||||
|
<span class="input-group-addon">Buffer</span>
|
||||||
|
<input id="bufferSize" name="bufferSize" class="form-control" placeholder="4096" required type="number" min="1024">
|
||||||
|
<span class="input-group-addon">B</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
<div class="checkbox" style="padding-right: 10px;">
|
<div class="checkbox" style="padding-right: 10px;">
|
||||||
<label>
|
<label>
|
||||||
<input id="ckb-keep-tcp-socket" type="checkbox" />
|
<input id="ckb-keep-tcp-socket" type="checkbox" />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user