Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info


    Currently node-printer works perfectly for me.

    But I need to print on a remote printer, isolating some TCP / IP protocol and port.

    so that the client using the web system can print a printer other than the sea that belongs to them. Is this possible?

    Simanto Rahman
    This uses some native functionalities of CUPS to send buffers and what not.
    I'd say, this would be a better usecase.
    An unhandled error occurred inside electron-rebuild
    Unable to find electron's version number, either install it or specify an explicit version
    when i run electron-rebuild
    Simanto Rahman
    Which version of electron and node are you on?
    current node just updated and idk what electron version or if i even have it installed
    where do i install electron
    Simanto Rahman
    Ok let's go over how far you've gone through setting up
    How did you start off the project?
    Anyone can tells me if this library runs in latest version of electron and how can i install it? There is a erro telling me that the version compiled of node is not the version required and when i run electron-rebuild or node-gyp there is a error in the rebuild too
    Simanto Rahman
    I believe this should be documented.
    @richardritech for the node module to work on your version of electron, you need ‘node-gyp’ and ‘electron-rebuild’. Read the usage on electron rebuild. It will rebuild node-printer for the correct version of nodejs.
    Vinícius Montanheiro
    Hello guys, just a question, is it possible to choose the pages for printing? Something like pageFrom and pageTo?
    Vinícius Montanheiro
    Hello guys, just a question, is it possible to choose the pages for printing? Something like pageFrom and pageTo?
    i need help for thermal printer
    need a example code for epson thermal printer in windows plateform.pls guys urgent.
    Cloud Han Xiao
    Dear all, I'm new to node-printer and want to use it in electron 7.1.13 with node 12.16.3, need help on how to install the package and build it, I simply cannot install it correctly. Thank you!
    Cloud Han Xiao
    I can install fork thiagoelg/node-printer successfully and it works well with Electron 7.1.13 and node 12.16.3, thanks.
    Vladimir Ruzic

    Hi all. I just started a project using electron 9.0.0 and when trying to use this module it fails with

    Error: The module '/Users/vladar/workspace/project/node_modules/printer/lib/node_printer.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 80. This version of Node.js requires NODE_MODULE_VERSION 72. Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`).

    I switched to thiagoelg/node-printer and it does not work either... Is there any way to solve this?
    Simanto Rahman
    Did you try electron-builder?
    Thiago Lugli
    I've updated my fork to support Node 14 and Electron 9, feel free to check it out
    I've also opened a PR to merge these changes to Tojocky original source(tojocky/node-printer#295)
    hi all I wanted to use the module for printing some stuff can i directly run it as a file
    like make app.js and app.js calls all the other functions in a certain manner
    will it work
    Hello! It is working in node v13?
    (not electron)
    I have a error - "The specified module could not be found."
    Felipe Gustavo
    Hi everybody, someone can help me make this works in my computer?
    I no have idea what i can do to fix this
    I've got a Windows solution for all of you guys. Initially, I was trying to use a node printer to print PDF files, but I kept bumping into so many issues. Eventually, I realized that you can print PDFs from the command line using some programs, sumtra PDF and ghostscript + gsprint.
    I packed it into an electron application and released it here cheap photo printer reviews as I use it for my company.
    Well i solved my problem by creating a c++ dll on windows for 32 bit only and using N-Api to integrate the c++ dll with node. Never happend a bug 100% working. Best idea ever.
    @richardritech thank you my friend !! I already use ffi-napi and I hadn't thought of that. thank you you are a genius

    Thanks to share, i'm cant make this lib run whith type pdf just print especial chars or give me the messageStartDocPrinterW error: code: 1804, message: O tipo de dado especificado é inválido.

    Im using this:

    var fs = require("fs");
    data: fs.readFileSync(filename),
    type: 'PDF',
    printer: printerName, ....

    Im use the https://github.com/artiebits/pdf-to-printer solve to me thanks man
    Hey guys, I'm trying to use this library but I'm getting an error on Mac. It works great on Windows through. The error says "No such file or directory".

    here is my code:
    var printer3 = require("@thiagoelg/node-printer");

    printer3.printDirect({data:'text messagetext messagetext messagetext messagetext messagetext messagetext messagetext messagetext messagetext messagetext messagetext messagetext messagetext messagetext messagetext messagetext message'
    , printer:''
    , type: "RAW"
    , success:function(){
    console.log("printed: ");
    , error:function(err){console.log(err);}


    I really appreciate your help or anything that can lead to an answer.
    Can I pay you guys to help me?
    José GC
    nic seltzer

    OS: Windows 10 // Node.js version: 14.17.5 // Electron version: 3.1.9

    As administrator, run npm install --global windows-build-tools. This installs a handful of libraries and dependencies
    needed to properly build the native code we will be compiling.

    npm install printer -- Pretty straight forward. It should go out and grab dependencies. This didn't work for me on a
    later version of Node.

    FROM THE DIRECTORY WHERE printer is downloaded (this will almost certainly be node_modules), do the following:
    npm config set msvs_version 2017
    npm config set python C:\Users\n\.windows-build-tools\python27\python.exe
    npx node-gyp rebuild --python C:\Users\n\.windows-build-tools\python27
    npx node-gyp rebuild
    npx electron-rebuild

    I tried and failed with:

    @thiagoelg/node-printer -- this probably would have worked, but I didn't have the above information before getting started, so DOOM.

    The exercise of how you integrate the package into your application is left to the reader. Documentation for the exposed API can be found here: https://github.com/tojocky/node-printer

    Thanks for making this project. It saved me from having to do it myself.

    gl hf

    -- nic

    Oh! And I added externals: { 'printer': 'commonjs printer' } to the webpack for my main.
    nic seltzer
    Final thought -- windows-build-tools, I pinned to 4.0.0
    hi mr.tojocky thank you for the great tools
    i wanna ask something
    i just build electron app using this library, but today i face a problem
    like the printer jobs never finished
    it just stuck at the printer queue