0
votes

I'm creating point of sales web based application using PHP. this application must can print to thermal printer. I use Star SP700. I'm already install printer driver and testing with "printer test page", and its works.

I tried using Mike42/escpos and following instruction from documentation

    require_once APPPATH.'vendor/autoload.php';
    use Mike42\Escpos\Printer;
    use Mike42\Escpos\PrintConnectors\FilePrintConnector;
    use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;

    $connector = new FilePrintConnector("php://stdout");
    $printer = new Printer($connector);
    $printer -> text("Hello World!\n");
    $printer -> cut();
    $printer -> close();

but this script giving me a blank page and not printing anything (on screen and printer). I'm using windows 10. how can fix this problem ? I expect my PHP script can print to thermal printer.

1
Is the setting mode different? How about changing the printer mode and device driver according to the manual or setting tool? Software Installation Manualkunif
@kunif I'm still facing problem. but found alternative solution from this medium.com/@adenovid/…Arif Nur Rohman

1 Answers

0
votes
use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;
use Mike42\Escpos\CapabilityProfile;
$profile = CapabilityProfile::load("SP2000")
$connector = new WindowsPrintConnector("smb://computer/printer");
$printer = new Printer($connector, $profile);