You create a port in Windows which is mapped to the USB port - in my case named Terow. You then create your text file and copy it to the port.
$file = "print.txt";
$handle = fopen($file, 'w');
$linefeed = chr(10);
$Data = "This is a test\n";
$Data .= "\n";
$Data .= "Line 1";
$Data .= "\n";
$Data .= "Line 2";
$Data .= $linefeed;
$Data .= $linefeed;
fwrite($handle, $Data);
fclose($handle);
copy($file, "//localhost/terow");
If I do the same with an image, as expected it prints junk. Can't find information on how to convert the image file to data that will be accepted by the printer.