-
Notifications
You must be signed in to change notification settings - Fork 111
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
My print only supports application/octet-stream - how can I print an image / pdf ? #101
Comments
Put a cups server in front of the printer and send your print to cups is probably the easiest path |
I mean, the printer I'm using is actually a normal printer and can obviously print everything correctly. I just need to use this printer over a cheap DS-510 silex network print server thing. Here I get an IPP address so I was thinking I could send a print request over this IPP library. I feel like I just need to tell the printer to print the document in the right format somehow. However, in this library it tells me that it only support "application/octet-stream"... |
application/octet-stream is just a generic mimetype that means binary. This probably means there is a particular format the printer needs - i.e. you need a special driver to communicate. You can figure that out or rely on something like CUPs to handle it. |
Okay I understand.. |
It is a print server that exposes printers for IPP Everywhere printing (which is what you want for printing a PDF if your printer doesn't offer this natively) - http://www.cups.org/ |
I'll look into that. Thank you very much! :) |
@thenewguy thank you so much. However, could you point me in the right direction of HOW to send a print job via nodeJS? |
I don't currently use this project. But it should work for you - in the past I've even made it work from the browser. But if you want help you'll need to have a more specific problem that shows what you've done/how you've done it, what the results were, and what you expected to happen. Hopefully someone who is currently using this code will be able to help you |
Sure.. This is the list of the supported Printer Attributes, when calling
Result:
So I can print from the printer. However, if I want to print a PDF file, then only garbage comes out of the printer (or the Printer prints the contents of the file, and not the actual file)
I've tried many variations (with and without using buffer for the data property. But the result is always like shown on the picture... I've set up the CUPS thing. Added my printer and can print test pages just fine.... But I'm struggling the issue a print command which prints proper pdfs from my nodeJS environment. |
I am a little confused by what you've sent. I thought you said CUPs worked? Now you replace your printer address with the cups address and communicate with the printer through CUPs |
Show the response from the CUPS server for the Get-Printer-Attributes. It should list application/pdf as a supported type |
Okay. So in my environment im running the cups server in a docker using this image: I connected my printer via USB to a Silex DS510 to make the printer discoverable in my network. I can add this printer in the cups server, see image attached: Unfortunately using this ipp library, I cannot comminacte with the cups server itself
Edit: I also tried this URI: http://127.0.0.1:631/printers/EPSON-TEST and I can't connect using this IPP library to his uri. I only can communicate via the local ip. |
You have to configure CUPs to allow network printing and make sure the networking is correct. I think this will work for you but you have to learn how to configure it. It depends on your particular hardware layout so I can't be much help here other than to say that I've used this library to print through cups from a web browser successfully. |
Hello,
I managed to connect to my printer with this library!
However, my printer ONLY supports application/octet-stream, How can I send it the right command to print a normal pdf.
I tried the example from this modules readme (any many others) but didn't get it to work.
I tried PDFkit and PCLkit
` const doc = new PDFDocument();
doc.fontSize(25).text("Some text with an embedded font!", 100, 100);
doc.end();
Any advice? :/
The text was updated successfully, but these errors were encountered: