[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: Sorce code of lp
Writing a program to print is not an easy task if you want to bypass lpd.
Unless your file is
pure postscript and your printer is a postcsript printer you could always
dump(say a cat) the file to /dev/lp*.
Or you could issue the command lpr which runs through various filters
(depending on your filetype and /etc/printcap settings)
and then sends it suitably to your printer. thats how netscape, staroffice,
abiword. do it. They just provide a text field to type your
lpr command and execute it blindly. The lpr takes care of queueing and
In short your program should just call lpr [options] filename :)
Sumit Rangwala wrote:
> I was trying to write a C program that would print a file on a
> printer. I think on Linux you need to submit it to lp ( a deamon) . If I
> intend to bypass the lp commnad where should i write the content of my
> file i intend to print . I thought of looking at the source code of lp
> but was unable to find it. Can someone help me out?
> Any pointers would be of great help.
> LIP is all for free speech. But it was created
> for a purpose. Violations of the rules of
> this list will result in stern action.