setJustification(Escpos::JUSTIFY_CENTER); $printer -> graphics($img); $printer -> cut(); } finally { // Always close the connection $printer -> close(); } } catch (Exception $e) { // Print out any errors: Eg. printer connection, image loading & external image manipulation. echo $e -> getMessage() . "\n"; echo $e -> getTraceAsString(); } finally { unlink ( $imgCombined_path ); unlink ( $tmpf_path ); }