Link to home
Start Free TrialLog in
Avatar of DWA
DWA

asked on

How to print to a printer?Want to print out regular text.I am on a linux os

I am on a linux os and trying to figure out how one can print out regular text to my printer.

I thought I could do something like this but found out I can't

  FILE *fp;
  fp=fopen("/dev/usb/lp0", "w");
  fprintf(fp,"hello");
  fclose(fp);


Thanks for your time and help.
Avatar of umangjoshi
umangjoshi

I havn't experience of the linux plateform. But this may help you.

if i want to print something on screen, i use
printf("%d",i);

if i want to print on printer, i use
fprintf(STDPRN,"%d",i);

so please findout something similar...
Avatar of DWA

ASKER

Yeah I have found some stuff on a google search that suggested what you said but no luck.So far I have not found a good answer with a google search

Thanks for your time and reply
Avatar of DWA

ASKER

Let me try a search on stdprn
Avatar of DWA

ASKER

I still have not found nothing that is worth a darn.

Here are a couple solutions...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_562c.asp

...but they look Microsoft Visual C++ or Windows-dependent.  
ASKER CERTIFIED SOLUTION
Avatar of darlingm
darlingm

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DWA

ASKER

Thanks to you all