I have this Zebra ZM400 Printer connected to the network (192.168.1.50
). And I am trying to push a content to this printer directly from PHP.
This is the idea and I am just stuck without any way to do this. I tried the file_put_contents('192.168.1.50', $content)
but with no success.
Would appreciate if anyone could please help me in sorting out this. Thank you :-)
.................................................................................................................................
Solution:
I printed using the LPR Protocol. No need to install driver or anything. The LPR Printing Class for PHP 5 can be downloaded from here:
http://www.phpclasses.org/package/2540-PHP-Abstraction-for-printing-documents.html
This is how to print on a Zebra Printer connected to the network: Assuming your printer is at IP: 192.168.1.50 and standard port : 9100
This is working 100% on any ZPL compatible printer, not only Zebra. In this Example we print a label with a big TEST ZEBRA PRINTER in it
There is sample code on how to send ZPL directly to Zebra printers at:
https://km.zebra.com/kb/index?page=content&channel=SAMPLE_CODE&cat=ZISV_PL_ZPL
I didn't see any in PHP, but there is an example of talking directly to the printer via port 9100 using VB.