Comments (10)
Yes, read the manual and send the cutter command to the printer. I did for Zebra printer at the moment when I initiated this project.
Feel free to share your results.
from node-printer.
Hi, you right.. sorry for not closing this issue.. i dont have computer until now...
I try to use the cutter but it doesn't cut... in the manual say this
GS V Select cut mode and cut paper
Format: ASCII: GS V m (n)
Decimal: 29 86 m (n)
Hex: 1D 56 m (n)
Description:
(There is only one cut mode can be selected if the cutter can only realize one cut type.)
m=0, 48; No n parameter, Executes a full cut.
m=1, 49; No n parameter, Executes a partial cut (with one point left in the middle).
m=6, n=0255; Feed paper to n_(horizontal or vertical motion unit) and executes a full cut.255; Feed paper to n_(horizontal or vertical motion unit) and executes a partial cut.
m=66, n=0
my code is this and doesnt work
var INITIAL_PRINTER = '\x1B\x40';
var PAPER_CUTTING = '\x1D\x56\x49';
function printZebra(barcode_text, printer_name){
printer.printDirect({data: new Buffer(INITIAL_PRINTER) + template + new Buffer(PAPER_CUTTING) + new Buffer(INITIAL_PRINTER)
, printer: 'EC_Printer_EC-80320:4'
, type: "RAW"
, success:function(){
console.log("printed: "+barcode_text);
}
, error:function(err){console.log(err);}
});
}
can you help me?
from node-printer.
Use node.js Buffer if you want to send bytes.
from node-printer.
Sorry, I missed that you already used Buffer. What about m variable? Is it in hex or in dec? I think you need to convert in hex, or you can send to buffer am array of dec values.
from node-printer.
Sorry, I missed that you already used Buffer. What about m variable? Is it in hex or in dec? I think you need to convert in hex, or you can send to buffer am array of dec values.
from node-printer.
it works... just convert 48 to hex... thank you
from node-printer.
You are wellcome!
Happy codding!
from node-printer.
hi tojocky ,
i have a same problem!! can u pls help me!!!
from node-printer.
Hi @DeepzSandra , as I mentioned above, use Buffer type instead of string.
from node-printer.
Thank u so much!!! Jocky.....
from node-printer.
Related Issues (20)
- Docs unclear - do I need Python on target server, or just on dev machine? Other related questions...
- npm install - The module was compiled against a different Node.js version HOT 3
- Unable to install from NPM HOT 11
- Version NodeJS and Electron HOT 1
- npm published package 0.4.0 doesn't include the fix in #292 HOT 1
- invalid ELF header
- printer.js MODULE_NOT_FOUND after compiling project with pkg HOT 1
- jobs doesnt get filled if printer is a shared printer
- How to get response from device? Not job status HOT 1
- can i delete the Build folder?
- Print PDF from URL HOT 3
- Files spooling but never printing
- Cannot find module './node_printer_darwin_x64.node' HOT 3
- Can't print the Image manipulated by Sharp library & converted into base64 & then after buffer! its prints special characters on Images! HOT 2
- Error: StartDocPrinterW error: code: 1804, message: The specified datatype is invalid. HOT 1
- Error: StartDocPrinterW error: code: 1905, message: ...
- alternative to image printing in windows
- Is it possible to use this on an MacBook M2 ( arm64 )? HOT 1
- Cannot find module './node_printer_win32_x64.node'
- Cant install npm install printer. HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-printer.