<?php
/* Print-outs using the newer graphics print command */

require __DIR__ . '/../autoload.php';
use Mike42\Escpos\Printer;
use Mike42\Escpos\EscposImage;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;

$connector = new FilePrintConnector("out.bin");
$printer = new Printer($connector);

try {
    $tux = EscposImage::load("c:/temp/img.png", false);
    
    $printer -> graphics($tux);
    $printer -> text("Signed by INCA Hellals\n");
    $printer -> feed();
    
    $printer -> cut();
} catch (Exception $e) {
    /* Images not supported on your PHP, or image file not found */
    $printer -> text($e -> getMessage() . "\n");
}

$printer -> close();
