mike42 / escpos-php

PHP library for printing to ESC/POS-compatible thermal and impact printers
Other
2.55k stars 863 forks source link

Print Job suddenly disappear when printing to Brother PT-P950NW #1299

Open istiqomahnf opened 9 months ago

istiqomahnf commented 9 months ago

Hi Mike @mike42 , i cant debug my app using laravel and use this library for auto print process here is my code : `try {

        $connector = new WindowsPrintConnector('Brother PT-P950NW');
 $printer = new Printer($connector);

        // $printer->initialize();
        // $printer->selectPrintMode(Printer::MODE_FONT_A);
        $printer->text('Qoms');
        // $printer->feed();

        $printer->cut();
        $printer->close();
    } catch(Exception $e){
        echo "Couldn't print to this printer: " . $e -> getMessage() . "\n";
    }

}`

the app doesn't show an error but the print job goes into the print queue and suddenly disappears after 2-3 seconds and the printer doesn't print anything. Is there something wrong with the code or is there a setting to display an error from the printer?

parallels999 commented 9 months ago

It seems to me that this printer does not support ESC/POS, just ESC/P

https://www.brother-usa.com/products/ptp950nw#specification Print Features

Emulations Raster, ESC/P, P-touch Template Print Commands Raster, ESC/P, P-touch Template