https://bugs.winehq.org/show_bug.cgi?id=39056
Bug ID: 39056 Summary: Redirect a device printer port to a print command (lpr) Product: Wine Version: 1.7.48 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: spooler Assignee: wine-bugs@winehq.org Reporter: hugocanalli@gmail.com Distribution: ---
Sometimes I need to write directly to a print port. That's because I have a old program that works only with ports named lpt[1-4] or com[1-4]
I can do it creating a link to my device to the dosdevices folder. E.g: ln -s /dev/lp0 ~/wine/dosdevices/lpt1 ln -s /dev/ttyUSB0 ~/.wine/dosdevices/lpt2
Typing commands like echo 'hello' > lpt1 will work great.
There are some cases that my printer is not directly connected to my computer. By example my Brother DCP-8085DN printer that works over network, a wireless printer, or same my epson lx300 using lpt1 port but instead is installed on another computer. To map this kind of printers I use cups and it work on wine using print dialog (e.g printing using notepad). But what about if I need to use my old dos program or would like play around with wine start.exe program and type commands like echo 'hello' > lpt1 Wine start.exe returns File not found.
Cups doesn't create /dev/xxx devices to printers. So I can't do a link to dosdevices folder and I have to use the lpr command to print. One solution is create a file named lpt1 on dosdevices folder and use loop script in linux cheking for changes and redirect data to lpr. I can do it easly using the following procedure: cd ~/.wine/dosdevices mkfifo lpt1 chmod 666 lpt1
And create a running forever script like:
while true do cat ~/.wine/dosdevices/lpt1 | lpr -o raw -P cups_printer_name done
While this method can work would be great if we could do it only using wine ways and therefore no need to such script.
https://bugs.winehq.org/show_bug.cgi?id=39056
Detlef Riekenberg wine.dev@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |wine.dev@web.de
https://bugs.winehq.org/show_bug.cgi?id=39056
Detlef Riekenberg wine.dev@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |printing
https://bugs.winehq.org/show_bug.cgi?id=39056
Detlef Riekenberg wine.dev@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEEDINFO Ever confirmed|0 |1
--- Comment #1 from Detlef Riekenberg wine.dev@web.de --- You do not need a script.
Wine has a builtin Port redirection to a pipe (or a unix file), which can be set in the registry in HKCU\Software\Wine\Printing\Spooler
Add a String with the portname as name of the String and the redirection-target as Value.
Start the redirection with the pipe symbol, followed by your command. "LPT1:"="|lpr -o raw -P cups_printer_name"
The Wine User Guide has a link to the related part in the Wine-Wiki: https://wiki.winehq.org/Useful_Registry_Keys
Please verify, that this works also with your old program and report back.
https://bugs.winehq.org/show_bug.cgi?id=39056
--- Comment #2 from Hugleo hugocanalli@gmail.com --- (In reply to Detlef Riekenberg from comment #1)
You do not need a script.
Wine has a builtin Port redirection to a pipe (or a unix file), which can be set in the registry in HKCU\Software\Wine\Printing\Spooler
Add a String with the portname as name of the String and the redirection-target as Value.
Start the redirection with the pipe symbol, followed by your command. "LPT1:"="|lpr -o raw -P cups_printer_name"
The Wine User Guide has a link to the related part in the Wine-Wiki: https://wiki.winehq.org/Useful_Registry_Keys
Please verify, that this works also with your old program and report back.
No
wine cmd echo 'test' > lpt1 returns File not found
https://www.winehq.org/pipermail/wine-users/2015-August/10