escpos-php icon indicating copy to clipboard operation
escpos-php copied to clipboard

printing very slow for arabic char

Open humam60 opened this issue 5 years ago • 3 comments

i am using pos printer i send data by ethernet "ip" but the printing process is very slow for arabic character

humam60 avatar Jan 12 '20 09:01 humam60

Hi,

It's not clear to me whether you are using escpos-php. If so, can you please share a minimal, self-contained PHP example which shows the problem, and describe the printing hardware and platform you're running on?

mike42 avatar Feb 06 '20 10:02 mike42

hi sir, i used more than one printer type and same resulkt i get , i used xprinter and tysso printer , and here is my code idk where is the delay

`$textUtf8 = "$food"; $maxChars = 80; $fontSize = 40;

mb_internal_encoding("UTF-8"); $Arabic = new \I18N_Arabic('Glyphs');

$textLtr = $Arabic -> utf8Glyphs("\n".$textUtf8, $maxChars); $textLine = explode("\n", $textLtr);

$noteLtr = $Arabic -> utf8Glyphs("\n".$note, $maxChars); $notetLine = explode("\n", $noteLtr);

 date_default_timezone_set("Asia/baghdad");



 try {
     $buffer = new ImagePrintBuffer();
 } catch (\Exception $e) {
 }
 $buffer -> setFont($fontPath);

$buffer -> setFontSize($fontSize); $profile = CapabilityProfile::load("default"); try { $connector = new NetworkPrintConnector($ip, 9100); } catch (\Exception $e) { }

$printer = new Printer($connector, $profile);

$printer -> setPrintBuffer($buffer); $printer -> setJustification(Printer::JUSTIFY_CENTER); $printer->text("(".$tbnum.")"."\n"); $printer->text($kordtype);

$printer -> setJustification(Printer::JUSTIFY_RIGHT); $printer->text("no:".$id." ".date("m-d h:i"));

foreach($textLine as $text) {

$printer -> text($text . "\n");

}

$printer -> cut(); $printer -> close();

return true;`

humam60 avatar Feb 10 '20 18:02 humam60

I18N_Arabic

can you show. me how did. you invoke I18N_Arabic?

vstarkx avatar Jan 29 '23 04:01 vstarkx