we are developing a system for restaurant chain so we have to print the receipt on the printer using IPaddress of the printer
They are Already having a printer of Star Micronics TSP700II. so we have to use those printer
In Epson we having EPOS SDK to print from WEB Environment
But for Star We are unable to use WEBPrint SDK. so what i have did is i have used a socket to print from direct PHP code itself on ipaddres of printer as given Below as .NET Using
$fp=pfsockopen("192.168.0.145", 9100);
if($fp)
{
fputs($fp, "This is Start\nBreak Now");
fclose($fp);
echo 'Successfully Printed';
}
And i got success also . but now issue is Star and EPSON have their Pre defined codes to Cut , Feed a Line , Bold , Color the fonts. so from .NET they doing their codes to Convert bytes
public static string Cut = Convert.ToChar(29) + "V" + Convert.ToChar(65) + Convert.ToChar(0);
This is direct command to cut the paper from printer after complete print receipt
So how i can use this command in php or is their any other way to print