I'm facing a very strange problem in thermal printer printing using php.
Everything is right, however the text is great it did not print everything, it has a standard print size. I could not find anything about it. Follow my code
function imprimir($texto){
$handle = printer_open("Daruma DR800");
printer_set_option($handle, PRINTER_MODE, "RAW",PRINTER_FORMAT_CUSTOM);
printer_start_doc($handle, "Print"); // Name Document
printer_start_page($handle);
$font = printer_create_font("Arial",40,16,PRINTER_FW_NORMAL,false,false,false,0);
printer_select_font($handle, $font);
$posicao = 10;
for($i = 0; $i < count($texto); $i++){
printer_draw_text($handle, $texto[$i], 10, $posicao);
$posicao = $posicao + 40;
}
printer_delete_font($font);
printer_end_page($handle);
printer_end_doc($handle);
printer_close($handle);
}
The variable $texto
is an array of strings.
Note: php is not the best option for local printing, but it is the one I need to use in the project.