-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nodejs document printing #13915
Comments
You can view the code and issue tracker for that module at https://github.com/alepee/node-printer. However, it was last published 2 years ago, and according to the README, the module should not be used. |
This issue seems to apply to the node-printer module, not Node.js itself. Please redirect your question to node-printer. Either way, it seems to me that the node-printer module depends on CUPS, which is Unix-only. |
I wanted to raise the issue of printing documents in general. |
I'm not quite sure what os.startfile("printme.txt", "print") does in Python, but if it is equivalent to const stdout = child_process.execSync('print printme.txt');
// or
child_process.exec('print printme.txt', (err, stdout, stderr) => {
// ...
}); should suffice. I'll close this ticket for now, but for future questions like this you should find more help at, well, nodejs/help. |
Thank you so much, that is exactly what I want! |
Omg, could somebody explain this, now the same code doesn't work! |
@lumenier1 I'm just guessing but the issue might be if your Could you provide more information about how does the "not working" look like? Does the child process throw or return a non 0 ERRORLEVEL? Does Also from personal experience I know that |
Thank you for taking some time for the answer. |
Hello,
Recently I've installed node-printer module but it doesn't work and I don't know why :(
When I try to log
Printer.list()
command (Get available printers list) it returns an empty array despite of the fact that I have a working printer and drivers installed.I really want to use nodejs for document printring.
I'm curious to know exactly how this module works? Does it send file to the printing queue or communicates directly to the printer?
Is there any way just to send files to the printing queue through a standard OS command? I know that it is pretty simple to do for win and linux using python. Unfortunately it is not feasible for node yet. But I don't want to use python script in conjunction with node!
Does anyone use node-printer module? Do you need any specific settings or installation for this?
I know that node has an os module but it only returns information about the system. Is it possible to create some function for node similar to python's that will start a file with associated application by os?
For e.g. this is code that works perfectly in python:
import os
os.startfile("printme.txt", "print")
Is it possible to do the same with just node child_process?
The text was updated successfully, but these errors were encountered: