GhOnDiE Posted January 10, 2007 Share Posted January 10, 2007 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 More sharing options...
tomfmason Posted January 11, 2007 Share Posted January 11, 2007 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.. Link to comment https://forums.phpfreaks.com/topic/33664-printing-raw-data-to-com-port/#findComment-157780 Share on other sites More sharing options...
fert Posted January 11, 2007 Share Posted January 11, 2007 php does have Printer functions Link to comment https://forums.phpfreaks.com/topic/33664-printing-raw-data-to-com-port/#findComment-157781 Share on other sites More sharing options...
GhOnDiE Posted January 11, 2007 Author Share Posted January 11, 2007 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]<?phpfunction 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.regardsnathan Link to comment https://forums.phpfreaks.com/topic/33664-printing-raw-data-to-com-port/#findComment-158096 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.