打印机是godex 的ez1105 经济型
标签打印机,使用这个打印机需要安装他的驱动以及使用相应的软件绘制条码进行打印,现在的需求是使用php对打印机进行打印内容的指定和打印操作,如何解决?除了php的方案,是否有其他的方式?
php_printer
$handle = printer_open('Godex EZ-1105');
printer_start_doc($handle, "My Document");
printer_start_page($handle);
$lfont = printer_create_font("Arial", 30,30, PRINTER_FW_BOLD, false, false, false, 0);
printer_select_font($handle, $lfont);
printer_set_option($handle, PRINTER_MODE, "RAW");
printer_set_option($handle, PRINTER_PAPER_FORMAT, PRINTER_FORMAT_CUSTOM);
printer_set_option($handle,PRINTER_PAPER_WIDTH,42);
printer_set_option($handle,PRINTER_PAPER_LENGTH,30);
echo printer_get_option($handle,PRINTER_RESOLUTION_X);
echo '
';
echo printer_get_option($handle,PRINTER_RESOLUTION_Y);
echo "
";
echo 'format'.printer_get_option($handle,PRINTER_PAPER_FORMAT);
echo "
";
echo "modal".printer_get_option($handle,PRINTER_MODE);
echo "
";
echo "width".printer_get_option($handle,PRINTER_PAPER_WIDTH);
printer_draw_text($handle, "Msup", 260, 0);
printer_delete_font($lfont);
printer_end_page($handle);
printer_end_doc($handle);
printer_close($handle);
?>