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

Please add printer model : Xprinter XP-420B

Open ahmaddum opened this issue 3 years ago • 1 comments

ahmaddum avatar Aug 25 '22 09:08 ahmaddum

Use the driver from here. https://www.xprintertech.com/xp-420b-2 Try the code below, its working on my end. Just fixing the alignment and feed options.

use Mike42\Escpos\PrintConnectors\CupsPrintConnector;

try { $connector = new CupsPrintConnector("Xprinter_XP-420B");

        $connector->write("WELCOME\n");
        $connector->write('THIS IS TEST');
        $result = $connector->finalize();

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

jcbolor avatar Feb 11 '23 16:02 jcbolor