EPSON non fiscal thermal printer does not work in a shared way with USB and LPT

Asked

Viewed 575 times

-2

I am creating a system in PHP and we are entering the printing phase with non tax thermal printers. In principle I did not find Epson support for PHP printing and in researches I found the component mike42/escpos-php. Using it I got network prints with Ethernet and local with USB. My client needs network LPT printing and also network USB.

The system will run on tablet’s and there will be a print server, where necessarily doesn’t have to be in PHP because it uses REST with the print data passed via JSON to it.

My need is to create a server(could be in another language, no problem) where it is possible to print other computers that have printers shared with it, but that the printers are USB and/or LPT.

Obs: In the description of the component mike42/escpos-php is that has support for shared printers, but in practice it was not possible as the message appears: Warning: copy( SERVER-NAME printer): failed to open stream: Permission denied in ... escpos-php-1.5.1 src Mike42 Escpos Printconnectors Windowsprintconnector.php on line 372.

Any suggestions, anyone ever come across similar situation?


On issues of file permissions, when giving permissions in the PRINTERS folder of both the server and the computer where the printer is installed and shared with the server the message remains, where according to the queries it should disappear. Joining this fact and that we are right at the beginning of the printout part, so it would not be a problem if the server were in another language, for example.


Thank you for your answers but so far without success.

  • Is the printer installed on the server? Is this permission problem not from the computer the printer is installed on? Work with a system that sends prints over the network and when the problem is permission, if OS is Windows we just give write permissions to users in the folder C:\Windows\System32\spool\PRINTERS.

  • There is the print server and another computer where the printer is installed and shared with the server. This has been done both on the server and on the computer that the printer is installed but the "Permission denied" message continues.

3 answers

1

On the issue of error Permission denied I believe you can solve with security options and users.

Edit

Try this: Printer Properties > Security > Add > Advanced... > Find Now > Select user "NETWORK SERVICE" > OK > OK > Mark print options and manage documents > OK. Take a test.

When you speak on LPT ports, any printer that is in the windows spooler, you can share and direct the LPT port to this share.

Ex: Epson X Printer, Filename Epsonx Server

execute the command: net use LPT1 Epsonx Server

from there, all prints sent to the LPT1 port will be forwarded to the server Epson.

  • The "net use LPT1 Server epsonx" command works but I believe it is a component error, so the possibility to use another language.

  • "Security options and users" -> I shared the entire PRINTERS folder and no response. How specifically would you solve the problem of "Permission denied"?

  • Which user is running the PHP server?

  • Windows user? I am using Wampserver with Windows user who has administrative permissions.

  • Being a service installed on Windows, likely to be running with system, or network service, try in the printer security tab to give permission to these users, you can do with the user All for testing, share believe not to be the case, after all the printer is on the same computer of the web server, correct?

  • The situation is that suppose there is a print server in one room, but a printer in another room (another computer) that must be shared with the server. Any station will send the print command to the server along with the selected printer, and the server will print to the corresponding independent printer that is installed locally on the same or shared via another computer.

  • I can’t simulate the same environment here =/ but would start with this issue of permissions, considering that it is still in windows environment, and there are file permissions and sharing permissions. Try printing with CMD commands to see if you can get results.

Show 2 more comments

1

Viewing line 372 of the Windowsprintconnector.php file:

return copy($from, $to);

We see that you are trying to make a copy of a file from one location to another. Check if you are allowed to create a file in the destination path folder specified in the variable $to and if the file path specified in $from is valid.

  • I shared the entire PRINTERS folder, where in research would solve the problem but no answer.

  • When I referred to permission I didn’t mean sharing, but rather the folder security permission (right to view, run, modify). Options: A) Linux would run a command like chmod 777 filename. B) Under Windows would right click on the folder, Properties > Security > Advanced > Find the user used at the time you run the program and give Full control of the folder, or C) by php could create a script with the following command: chmod('/home/path/directory/', 0777);

0

Good night. I was able to solve the problem by giving permission in the folder C:\Windows\System32\spool\PRINTERS and adding Users: smb://Users@nome_do_pc/nome_da_impressora

Browser other questions tagged

You are not signed in. Login or sign up in order to post.