1
I have a non-tax Zebra TLP 2844 thermal printer, and I’m developing a password generation program to print on that printer.
I’m using the functions printer_
.
I tried the following example code:
<?php
$handle = printer_open();
printer_write($handle, "Testando...");
printer_close($handle);
?>
But it is not printing the text of "printer_write". What I might be doing wrong?
I need to print without opening the printer’s choice dialog, so I thought of this method. Could someone tell me another?
Just one observation... Have you ever thought of using any programming language even for this? Hardly languages made for scripts, Like PHP, they will give you the control you want for this type of application (some people do "software" in PHP, but it’s like taking a knife to unscrew a PC cabinet). If you’re familiar with something like C, C++, C#, Delphi, or the like, and you’re starting to do the app yet, it might be worth rethinking from the start. Remember that nothing prevents you from having an executable that interacts with your remote application in PHP, transparently.
– Bacco
The printer is set to Default Printer?
– Tony
Usually to print you need to send the correct command. The plain text, has printers that does not come out. You need to see the printer commands manual.
– Tony
As @Tony said, it’s critical to read the printer’s manual. Most likely with an application running locally, you’ll have full control over the output, including taking advantage of its native, high print speed formatting. Using printing by normal windows graphics driver, or even plain text, almost everything the printer provides native resource is lost (this if you can print).
– Bacco