Interface to USB receipt printer in a point of sale system using PHP -


i writing system in php requires interface usb thermal receipt printer friend upon form submission. have read interfacing devices containing parallel port there has not been detail on how can use php interface usb thermal receipt printer.

so far have designed receipt consisting of data has been posted form. next step reproduce on thermal printer.

<?php $handle = fopen("prn", "w"); // note 1  fwrite($handle, 'text printer'); // note 2  fclose($handle); // note 3  ?> 

this found on http://www.kksou.com/php-gtk2/recipes/0399.php

  1. establish connection receipt printer through prn.

  2. writes receipt printer through file handle.

  3. disconnect printer.

it rather vague? idea how works?

well if using php on win32 platform there printers pecl module can installed. can use printer using existing driver setup.

depending on printer in use may possible use directly if know command language, epl/zpl/etc., set printer raw mode , post commands.

alternative:

you can access usb bus php directly, if setup usb serial port , use direct io functions library dio. remembering set serial options using mode command before commencement.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -