dongwei9771 2018-11-16 03:05
浏览 220

PHP - 打印RAW未打印(热敏打印机)

I already create PHP function using ext printer.dll and its work when print TEXT only.

This my PHP function

$handle = printer_open('Printer Name'); 
        printer_start_doc($handle, 'My Document200');
        printer_start_page($handle);
        $ret = printer_write($handle,'Hello');
        printer_end_page($handle);
        printer_end_doc($handle);
        printer_close($handle);

it works .

But when iam print RAW script it returned blank (but printer is running) This is my PHP function for RAW (using ZPL command)

            $handle = printer_open('Printer Name'); //or it could be \\pcname\printername
        printer_start_doc($handle, 'My Document200');
        printer_start_page($handle);
        printer_set_option($handle, PRINTER_MODE, 'RAW');

        $esc = chr(94);
        $data = ' ';
        $data .= $esc . 'XA';
        $data .= $esc . 'FX  Third section with barcod' ;
        $data .= $esc . 'BY1,5,30' ;
        $data .= $esc . 'FO600,130' . $esc . 'BC' . $esc . 'FD1234' . $esc . 'FS';
        $data .= $esc . 'XZ';

        $ret = printer_write($handle,$data);
        //close the printer handle
        printer_end_page($handle);
        printer_end_doc($handle);
        printer_close($handle);

I am using Wincode C342 Printer which is support ZPL command. What is wrong? is it because driver?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 simulink单相桥式整流电路
    • ¥35 问问51单片机流水灯的代码该怎么写
    • ¥15 关于#百度#的问题:感觉已经将字体段落、字体、页边距、纸张大小、文档网络调成与论文模板一致,为什么黄色部分字体左右的间距还是不一样啊,求私信发文件接收看一下
    • ¥15 stata webuse报错
    • ¥15 TypeError: Cannot read properties of undefined (reading 'status')
    • ¥15 如何利用AI去除图片中的竹架子
    • ¥15 python 写个基金爬取的代码,自动卖出功能
    • ¥15 Linux系统启动不起来
    • ¥15 为什么运行仿真数码管不亮(语言-c语言)
    • ¥15 陈仁良《直升机飞行动力学》小扰动线化方程如何推导