How can I print a PDF on a Zebra ZT411 printer via PHP

67 Views Asked by At

I want to print .pdf files on a Zebra ZT411 via PHP or Cups.

I am currently using a PHP script which extracts labels from my database and sends them to the printer. Currently they are all formatted in ZPL. This works perfectly. Now I want to send PDF files to the Zebra printer. Unfortunately, this does not work like ZPL by simply sending it to the printer via port 9100. I have already tried to solve this via a CUPS but unfortunately this did not work.

Code for ZPL print:

$fp = @pfsockopen($printer_out, 9100, $errno, $errstr);
fputs($fp, $zpl_string);
fclose($fp);

1

There are 1 best solutions below

0
ZRep On

The easiest way is to enable PDF direct on the printer, which is a emulator for PDF that allows the printer to process PDF files without any conversion. This emulator is embedded in the latest firmware, so most likely you'll just have to activate it. Search for PDF direct on the Zebra support community and you'll find how to activate it.