Pregunta

I have enabled the LPD and LPR on a Windows 8.

I want to print some files using the LPR command, but i can't even find the printer with the LPQ.

I can print normally with the printer through (ctrl + p), but i can't find it with the LPQ command.

C:\>lpq -S localhost -P HiTi_P510L

Servidor LPD do WindowsErro: the specified printer doesn't exists.

If i try to run the LPR directly i have the same error saying that the printer doesn't exists.

C:\>lpr -S 127.0.0.1 -P HiTi_P510L camila.jpg
Erro: o servidor de impressão não aceitou a requisição. Trabalho interrompido.

The event log:

LPD refused the job \\127.0.0.1\HiTi_P510L because the specified printer doens't exist on this computer.

net view:

C:\Windows\system32>net view \\myserver
Recursos compartilhados em \\myserver

Nome do compartilhamento  Tipo       Usado como  Comentário

--------------------------------------------------------------
HiTi_P510L                Impressão              P510L
Comando concluído com êxito.

C:\Windows\system32>

update: port 515 is listening.

C:\>netstat -an

Conexões ativas

Proto  Endereço local         Endereço externo       Estado
TCP    0.0.0.0:80             0.0.0.0:0              LISTENING
TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
TCP    0.0.0.0:445            0.0.0.0:0              LISTENING
TCP    0.0.0.0:515            0.0.0.0:0              LISTENING
TCP    0.0.0.0:2869           0.0.0.0:0              LISTENING 
TCP    0.0.0.0:49152          0.0.0.0:0              LISTENING
...

I can also telnet localhost 515 which gives me a black screen, and after i press ENTER i have this:

☺

Conexão ao host perdida.

C:\Windows\system32>

Any suggestion?

¿Fue útil?

Solución

UPDATE: There are two issues here. The answer to the question regarding LPR/LPD is resolved here while the other issue was relating to the actual print stream is answered at the bottom of this response.

Ensure your firewall is off (or at least allowing 515 to pass through). Also, ensure you are using the IP of your network adapter and not local host as LPD tends to bind to an actual IP address.

If you want to ensure that your data is passed through without modification / encoding then use -o l in the command line. For example:

lpr -S <workstation_ip> -P <printer_share> -o l test.ps
lpr -S 192.168.1.6 -P P510L -o l test.ps

Also ensure the file you are sending is actually supported by the print device. While some printers support graphic formats most are expecting PCL, PS, XPS, PDF etc. Some support TIF and other JPG etc. Ensure the file you are sending is supported by the device.


In the end the issue appears to be the proprietary nature of the device and as such, the requirement is there to push the file through the print driver. One simple way is to use a graphics application that supports command line printing. One option is MS Paint.

mspaint /pt IMG_1234.jpg "Hiti P510L"

The printer name (Hiti P510L) is the name that appears in the devices and printers screen in Windows.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top