Where can I find an example program in C to print to a network attached HP printer.
Printing requires a printer driver which handles all the task of communication with the printer.
all you have to worry about is how to print, the fact that the printer is networked or usb or parallel doesn't matter
If you're hardcore and want to use the windows API (assuming you're on windows)
otherwise you could simply redirect output from STDIO like this article suggests
It depends how you want to talk to the printer. Nowadays a lot of printers can support many different network protocols to receive jobs. So which is it:
- IPP (Port 631)?
- LPR/LPD (Port 515)?
- AppSocket (Port 9100 and others) ?
- FTP? RCP? SCP?
Anyway, for most of these cases you can find example code here: http://svn.easysw.com/public/cups/trunk/backend/ -- Further help here: http://www.cups.org/documentation.php/api-filter.html
(However, I wonder why you want to implement such a thing yourself on Linux...)