Web print SDK from DigiCode Kft. The code makes easier the web print from server side to a local printer. It works mainly for label printers from Zebra, Honeywell, Intermec, TSC but it can be used with classic printers, like HP, Konica, etc..
First of all you must check the available methods for printing, mostly the set_ functions. The driver files not required for the direct socket connection, but you must send the manufacturer created script language to the printer. For example: with Zebra printer you must user ZPL program language.
If your website out of localhost or the printer is not published to the web, you must set firewall port forwarding in router.
error_reporting(E_ALL);
include_once("print_send.php");
include_once("print_send_lpr.php");
$text = "Hello world!"; // zpl/epl/ipl formatted label view
$lpr = new Print_send_lpr();
$lpr->set_port("6001");
$lpr->set_host("192.168.1.1");
$lpr->set_data($text);
$lpr->print_job("Queue 1");
$lpr->get_debug();
EPL the oldest label print language, its a acronym for Eltron Program Language, the company bought by Zebra. The ZPL acronym for Zebra Program Language, the current version is ZPL v.2.0. IPL mean Intermec Program Language.
If you need any device for testing the code feel free to contact us. You can choose any barcode label printer on our website.