Closed mimbar closed 5 years ago
i'm using EscposImage to print image. bu everytime i try to print, the message always show: Print connector was not finalized. Did you forget to close the printer?
I'm using laravel btw.
here is the code:
$connector = new WindowsPrintConnector("BT"); /* Print a "Hello world" receipt" */ $logo = EscposImage::load("escpos-php.png", false); $printer = new Printer($connector); /* Name of shop */ $printer -> selectPrintMode(Printer::MODE_DOUBLE_WIDTH); $printer -> graphics($logo); $printer -> setTextSize(1,1); $printer -> text("Rumah Kopi Baretto.\n"); $printer -> selectPrintMode(); $printer -> text("Jl. Galunggung No. 85.\n"); $printer -> feed(); /* Title of receipt */ $printer -> setEmphasis(true); $printer -> text("Tanggal Transaksi.\n"); $printer -> setEmphasis(false); /* Footer */ $printer -> feed(2); $printer -> setJustification(Printer::JUSTIFY_CENTER); $printer -> text("Terimakasih atas kunjungan anda.\n"); $printer -> text("Follow Instagram kami di @rumahkopibaretto\n"); $printer -> feed(2); $date = "Monday 6th of April 2015 02:56:25 PM"; $printer -> text($date . "\n"); /* Close printer */ $printer -> pulse(); $printer -> cut(); $printer -> close();
but when i remove it i can print. but i need to print the logo/image.
my mistake. works when i write file name correctly.
This is happening to me. But my file names are correct. Any ideas?
This is happening to me. But my file names are correct. Any ideas?
Did you solve this somehow? Getting the same error, only on PHP8... PHP7 works fine
I don't recall how I got it working, but here is my working logo on my receipt. Btw I am using PHP 8 also.
$logo = GdEscposImage::load("images/logo.png", true);
// Print top logo
$printer->setJustification(Printer::JUSTIFY_CENTER);
$printer->bitImage($logo);
Thank you, it seems that the Intl module is not enabled in my case.
i'm using EscposImage to print image. bu everytime i try to print, the message always show: Print connector was not finalized. Did you forget to close the printer?
I'm using laravel btw.
here is the code:
but when i remove it i can print. but i need to print the logo/image.