Skip to content
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

Printing to LPT1? #225

Open
dpskipper opened this issue Feb 18, 2023 · 2 comments
Open

Printing to LPT1? #225

dpskipper opened this issue Feb 18, 2023 · 2 comments

Comments

@dpskipper
Copy link

Any ideas how to print to a parallel printer on port LPT1?

Have tried using serial printer, but its not finding any ports called LPT1, probably because you can't use serial ports to print parallel.

@lukevp
Copy link
Owner

lukevp commented Feb 25, 2023

I don't currently have a way to test this as I don't have any computers with LPT ports. It doesn't work the same as a serial port though from my limited research. If you're on Windows, there are examples about how to use native Windows dlls to open a pseudo file handle to the LPT1 port by name and write files to it.

You could write a Parallel implementation based on FilePrinter but using the native windows comm to connect to LPT1. I'd be interested in a PR for it, but only if we were able to dynamically wrap it, so that even if the implementation only worked on Windows, the library could continue to target .net standard and not target full .net framework. This project needs to remain cross-platform first and foremost. I'm curious if LPT would work from Linux or Mac using FilePrinter like serial does.

@igorocampos
Copy link
Collaborator

Hey @lukevp and @dpskipper I have successfully printed to LTP1 before, but it was with my old library. It lacks a LOT of features that ESC-POS-.NET has, but it uses temp files to handle sending the bytes to a port, that way I didn't have to worry about opening and closing ports and addresses, the OS did it for me. Beware it was never tested on MacOS, but I'm pretty sure it worked on linux if I remember correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants