i want to print directly to a printer using PHP, but i have a problem..
It showed up in the printer's queue, but it didn't print at all.. the status change from print to delete in a split second
Here's the code i'm using :
if($ph = printer_open('EPSON TM-U210B Partial cut')){
printer_set_option($ph, PRINTER_MODE, "raw");
printer_write($ph, 'testing');
printe开发者_如何学编程r_close($ph);
}
thanks
you'll have to start a document and create a page in it to write on. The result should look like this:
<?php
$ph= printer_open('EPSON TM-U210B Partial cut');
printer_start_doc($ph, "My Test-Document");
printer_start_page($ph);
// your code here
printer_write($ph, 'test 123 ...');
printer_end_page($ph);
printer_end_doc($ph);
printer_close($ph);
?>
精彩评论