Jump to content

Printing raw data to com port


GhOnDiE

Recommended Posts

hi there, im going to make myself a service administration system with php for our shop, to keep track of the repairs that we take in, price etc. the actual making of the intranet site is not the problem, what i want to be able to do is fill in all the fields like a normal form, and then press accept, it creates a job referance and then it will print out a recipt that i can stick to the item and the other part give to the customer ( two ply paper) my problem is that im not sure how i would be able to print from my server which will be upstairs. from php on a website. the recipt printer that we have will accept raw serial data from the com port.
is it possible to output data from php directly to the comport, server side??? or if not would it be easier for php to create a file that will then be preinted by some form of cron job?

anybody got any ideas on what to do,
regards.
Link to comment
https://forums.phpfreaks.com/topic/33664-printing-raw-data-to-com-port/
Share on other sites

Well if you are using windows you could use COM. You could use a basic html file, fill in the necessary info and then print it all via Word.. I know that this sounds complicated and it is but it would be worth it.. Now I am unsure how this would be done in a *nix platform.. I am sure that there are command line printing apps for *nix.. So in that case all you would have to do is access the command line from one of the system functions..
thanks i was under the impression that the pecl printer function was for windows machines only. i done a search for printer function and found this.
[code]
<?php
function lpr($STR,$PRN) {
  $prn=(isset($PRN) && strlen($PRN))?"$PRN":C_DEFAULTPRN ;
  $CMDLINE="lpr -P $prn ";
  $pipe=popen("$CMDLINE" , 'w' );
  if (!$pipe) {print "pipe failed."; return ""; }
  fputs($pipe,$STR);
  pclose($pipe);
} // lpr()
?>[/code]

hopefully it will work i will give it a try today.

cheers for the replies it sent me off in the correct direction at least.

regards
nathan

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.