mrothenbuecher / zpl-rest Goto Github PK
View Code? Open in Web Editor NEWREST-API / frontend to send ZPL/ZPLII to a zebra label printer
License: MIT License
REST-API / frontend to send ZPL/ZPLII to a zebra label printer
License: MIT License
Hey @mrothenbuecher,
first of all, awesome work here! Helped me a lot in my project :)
By accident I found a little issue when my printer was not reachable. I called the /rest/print
endpoint, which correctly responded with failure: true
. After a little more time, the server then crashed with these logs
Mon May 01 2023 13:46:05 GMT+0200 (Central European Summer Time) Error: connect ETIMEDOUT 192.168.1.22:9100
node:_http_outgoing:644
throw new ERR_HTTP_HEADERS_SENT('set');
^
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
I looked into it and nailed it down to the client.on('error', ...)
handler, which was called a long time after the timeout handler was called. The callback then calls res.send
which causes this error because the response was already sent.
However, I fixed it locally by making this small change here:
client.setTimeout(5000, function() {
console.error((new Date()) + " " + "connection timed out");
job.failed = true;
job.error = "connection timed out";
callback(job);
client.destroy(); // was client.end() previously
});
Basically by destroying the client, it is ensured that the other callbacks are not called anymore. Do you want me to submit a pull request?
Hello,
First of all, thanks for all your work on this project. It was almost exactly what I was looking for and I'm looking forward to implement it in my system.
I am using Saltcorn low code application builder to create a project, and it looks to me that you might have used Saltcorn, or at least Saltcorn's theme to create your project. It would be extremely helpful to me to be able to integrate your project into mine rather than having two separate apps running at once. Do you have a plugin or a pack for me to upload into my Saltcorn project with the code/tables/views needed for ZPL rest?
Thanks again.
Hey There!
Really excited about using this! It seems to be EXACTLY what we need and is making this process so much easier. However, one thing we are having issues with is special characters. When added directly to the template they print just fine. However, when contained in the json they seem to be getting reformatted before being applied via mustache. I'm trying to find where this might happen in the code, but im not really a Node pro.
Any ideas on how to fix?
Hello,
I plan to use this project in our company as middleware between our CMS and the printer.
We need to print a label multiple times (30-50) in a row. I didn't find an option to define the print quantity.
Am I blind or is there no such option? What is the best approach here?
How can I implement QrCode????
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.