225 below) and printing w/ Escpos::IMG_DOUBLE_WIDTH | Escpos::IMG_DOUBLE_HEIGHT */ try { /* Set up command */ $source = "http://en.m.wikipedia.org/wiki/ESC/P"; $width = 550; $dest = tempnam(sys_get_temp_dir(), 'escpos') . ".png"; $cmd = sprintf("wkhtmltoimage -n -q --width %s %s %s", escapeshellarg($width), escapeshellarg($source), escapeshellarg($dest)); /* Run wkhtmltoimage */ ob_start(); system($cmd); // Can also use popen() for better control of process $outp = ob_get_contents(); ob_end_clean(); if(!file_exists($dest)) { throw new Exception("Command $cmd failed: $outp"); } /* Load up the image */ try { $img = new EscposImage($dest); } catch(Exception $e) { unlink($dest); throw $e; } unlink($dest); /* Print it */ $printer = new Escpos(); // Add connector for your printer here. $printer -> bitImage($img); // bitImage() seems to allow larger images than graphics() on the TM-T20. $printer -> cut(); $printer -> close(); } catch(Exception $e) { echo $e -> getMessage(); }