Print to Zebra printer in php

前端 未结 5 1787
没有蜡笔的小新
没有蜡笔的小新 2020-12-29 00:15

Looking for the proper code to print from php web page to a zebra IP printer using RAW port 9100. Does anyone know if this is possible? I need to send a string in ZPL format

5条回答
  •  佛祖请我去吃肉
    2020-12-29 01:02

    The printer_open() and related functions are not part of the standard PHP language; they are part of an extension.

    If you want to use them, you'll need to install the extension: See here for info on the printer extension.

    However, please note that this extension is only available for PHP running on Windows.

    If your server is not Windows, you will need to use an external program to send data to the printer. An example might look like this:

    exec("lpr -P 'printer' -r 'filename.txt');
    

    This info, and more can be found elsewhere on SO -- eg here: printing over network from PHP app

    Hope that helps.

提交回复
热议问题