Search code examples
phppoint-of-saleprinters

Print to external receipt printer using PHP


I'm trying to find a solution for sending live orders to a receipt printer.

Basically in pseudo-code:

if ($order == 'success')
{
    $printer = ip.to.remove.printer;

    $receipt_text = 'You just received an order!';

    $ch = curl_init('http://addresstosomekindofapi.com/print_receipt/');
    curl_setopt($ch, SOME_OPTION, 0).............;

    curl_exec($ch);
    curl_close($ch);
}

I'm just exploring options in getting this done. It would be awesome to be able to do this rather than send faxes which often have tied up lines, etc, etc.

How could one achieve this?


Solution

  • To me, a solid solution is to build a desktop application that is connected to your web application and has the ability to send jobs to the printer. I don't think a web application can have much of control as to handle user's print jobs.