[LCP]Another printing issue

Erik Mouw J.A.K.Mouw at ITS.TUDelft.NL
Sat Oct 20 20:34:18 UTC 2001


On Fri, Oct 19, 2001 at 06:28:30PM +0500, Francisco Hallo wrote:
> How do I send control characters to the printer?. My printer has the
> ASCII control code  SI  to select condensed mode, but sending
> ....
> prnt=open("/dev/lp1",O_WRONLY);
> .....
> write(prnt,"SI",2);
> .....
> 
> is not correct ,  on the other hand SI is not a valid  escape sequence,
> could any body  give me a hint?, I want to use some other control codes
> like performing 2/180-inch line feed advances as needed.

C allows you to put octal codes into a string. For example: "\061\060"
will print "10".


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2783635  Fax: +31-15-2781843  Email: J.A.K.Mouw at its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/



More information about the linuxCprogramming mailing list