Giter VIP home page Giter VIP logo

Comments (10)

tojocky avatar tojocky commented on June 6, 2024

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.

dantero00 avatar dantero00 commented on June 6, 2024

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.
m=66, n=0
255; Feed paper to n_(horizontal or vertical motion unit) and executes a partial cut.

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.

tojocky avatar tojocky commented on June 6, 2024

Use node.js Buffer if you want to send bytes.

from node-printer.

tojocky avatar tojocky commented on June 6, 2024

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.

tojocky avatar tojocky commented on June 6, 2024

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.

dantero00 avatar dantero00 commented on June 6, 2024

it works... just convert 48 to hex... thank you

from node-printer.

tojocky avatar tojocky commented on June 6, 2024

You are wellcome!
Happy codding!

from node-printer.

DeepzSandra avatar DeepzSandra commented on June 6, 2024

hi tojocky ,
i have a same problem!! can u pls help me!!!

from node-printer.

tojocky avatar tojocky commented on June 6, 2024

Hi @DeepzSandra , as I mentioned above, use Buffer type instead of string.

from node-printer.

DeepzSandra avatar DeepzSandra commented on June 6, 2024

Thank u so much!!! Jocky.....

from node-printer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.