hi all
im trying to print html documents to the printer. i come accross the php printer functions and have tried it and it seems to work ok however when the document enters the queue it goes into an error and it doesnt print out properly.
heres the code below.........
<?php
$i = 1;
function printer($text) {
$handle = printer_open("ml1210");
$handle = printer_open();
printer_start_doc($handle, "My Document");
printer_start_page($handle);
// $font = printer_create_font("Arial",72,48,400,false,false,false,0);
// printer_select_font($handle, $font);
// printer_draw_text($handle, $test, 10, 10);
// printer_delete_font($font);
if (printer_write($handle, $test)) {
echo "printing ok..";
}else{
echo "printing not ok.";
}
printer_end_page($handle);
printer_end_doc($handle);
printer_close($handle);
} // end printer
$text = "WHAT THE HELL THIS IS PRINTED!!";
if ($i = 1) {
printer($test);
echo "printing....";
}else {
echo "cant print";
} // end if
the above is only a test script but see if you think i have done anything wrong. the php.ini setting for my default printer is set to the name of my networked printer the samsung ml1210.