printer_write():无法分配printerjob

时间:2018-10-01 12:30:43

标签: php printing

im托盘直接打印为PDF,但出现此错误“警告:printer_write():无法分配printerjob [3003]”

$printerName = "Microsoft Print to PDF";
$productName = "Epson LX-300+ ii Dot-Matrix";
$productCode = "PROD1";
$printer = printer_open($printerName); 
printer_set_option($printer, PRINTER_MODE,         "text");
printer_set_option($printer, PRINTER_ORIENTATION,  PRINTER_ORIENTATION_PORTRAIT );
printer_set_option($printer, PRINTER_TEXT_COLOR,   "000000" );
printer_set_option($printer, PRINTER_TEXT_ALIGN,   PRINTER_TA_LEFT); 
printer_set_option($printer, PRINTER_TEXT_ALIGN,   PRINTER_TA_CENTER);   
printer_set_option($printer, PRINTER_PAPER_FORMAT, PRINTER_FORMAT_CUSTOM);
printer_set_option($printer, PRINTER_PAPER_WIDTH , 210); 
printer_set_option($printer, PRINTER_PAPER_LENGTH, 75);   
$txt = PHP_EOL.PHP_EOL."\t\t\t\t $productName"
     . PHP_EOL.PHP_EOL."\t\t\t\t $productCode";
printer_write($printer, $txt);
printer_close($printer);

0 个答案:

没有答案