4
I am developing a web system where I need to print a label and a non tax receipt after sending a certain form. To perform this action, I have two printers:
- Matricial MP-20 MI Non Tax Printer - For the Non Tax Coupon;
- Zebra TLP 2844 Non Tax Thermal Printer - For Label;
I even managed to print using the DLL php_printer PECL with php, but it wasn’t working the way I needed it: the print hangs, sometimes sends and doesn’t print anything. It’s pretty unstable!
I tried to make use of the library escpos-php and the Matrix printer worked correctly, but the Zebra printer does not print the text I send.
Vi that it is possible to perform a configuration in the browser (Firefox only) so that the user can print without opening the dialog box, but for this the user needs to perform a configuration in the browser and it is possible to use only one printer and not two, according to my need.
For compatibility reasons I cannot have a java applet on the machine.
I cannot use Vbscript or Activex, as I cannot force the user to use only a specific browser.
Is there any other way to make this impression with PHP, Node.js or javascript?
If it were a "common" printer there is the "print" command of Windows itself, which could run with "exec()", it would be something like
exec("PRINT [/D:device] [[drive:][path]filename[...]]");
, I couldn’t find an official documentation link. There may be some other CLI software for printing more complex documents, such as http://www.doc2prn.com/, I have never tested, but only one example.– Inkeliz
window.print();
doesn’t solve?– Ivan Ferrer
No, yeah
window.print()
will open the browser print pattern screen.– Adriano de Azevedo
Seria
CTRL SHIFT P
?– Wallace Maxters