dongliao4353 2019-01-15 07:20
浏览 179

php7打印html表(条形码)到网络打印机

I'm new to PHP and searched for a solution, but nothing solved my problem. I use PHP Version 7.3.0 and so far, my code creates a barcode using tables. (there's more code above, this is just how the final output(what I want to print) gets generated)

$html="<table cellpadding=0 cellspacing=0><tr>"; 
for($x=0;$x<strlen($w);$x+=2) // code 128 widths: black border, then white space
$html .= "<td><div class=\"b128\" style=\"border-left-width:{$w[$x]};width:{$w[$x+1]}\"></div>"; 
return "$html<tr><td colspan=".strlen($w)." align=center><font family=arial size=2><b>$text</table>"; 

Example how the page looks like after the barcode creation:

Barcode

What I am looking for is a way how I can print this on a network printer. (static IP) Is there any possible way to do this without any other downloads? If not, what do I need for it to work in php7? Printing it on a label Printer is also possible if that is easier.

Thank you.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 matlab求解平差
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料
    • ¥15 使用R语言marginaleffects包进行边际效应图绘制
    • ¥20 usb设备兼容性问题
    • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
    • ¥15 安装svn网络有问题怎么办