Open jumarjuaton opened 3 years ago
Hi there. This package does not have that at the moment, but I am planning to add it soon because there are several requests about that recently.
I see, I guess to have to use mike42/escpos-php for now. Thank you @charlieuki
As a temporary solution, here's the code someone can use in Laravel with mike42/escpos-php (with pulse()
method).
Note: This is for Windows connector only. This only serves as basis. Don't forget to install the package on your project first.
composer require mike42/escpos-php
Controller:
<?php
namespace App\Http\Controllers;
use App\Http\Controllers;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;
use Mike42\Escpos\Printer;
class PrinterController extends Controller
{
public function test()
{
try{
$connector = new WindowsPrintConnector("Printer-Name-Here");
$printer = new Printer($connector);
$printer->text("Hello World!\n");
$printer->cut();
$printer->pulse();
$printer->pulse(1);
$printer->pulse(0, 100, 100);
$printer->pulse(0, 300, 300);
$printer->pulse(1, 100, 100);
$printer->pulse(1, 300, 300);
$printer->close();
} catch (Exception $e) {
echo "Couldn't print to this printer: " . $e -> getMessage() . "\n";
}
}
}
Hello,
I was testing out the cash drawer, and using pulse() method in mike42/escpos-php works fine? I just followed this:
Does your package have something like this too?