Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report printing on laser printer

Status
Not open for further replies.

surnj1

Technical User
Dec 27, 2001
46
US
Hi,

I have written a 'C' programme that generates report in a flat text file. Then i print that text file using a 'lp' command in a simple shell script.

in a short, i need to insert page-break characters in my report file so that i can control page-braking from my 'C' programme. How do I do this? what sequence of character do i need for HP Laserjet 4100 series printer?

am i doing right? i.e generate report in a text file & then print using 'lp'. Or someone know betterway to print directly from 'c' programm?

Thanks for any comment
 
The standard is ^l , control l, character 12 of ascii.

Ed Fair
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
In your C program you can write to stdout like this:
Code:
printf("%s\r\n",LineToPrint);
For a page break simply code this line:
Code:
printf("\f");

Hope This Help
PH.
 
Thanks,

I got it. It works good. one thing i was asking that can i use DOS like stdprn device to print to printer:

printf(stdprn, "string to be printed");


is there any Unix equivalent? i know in unix every thing is diff. than in DOS. Still someone have better idea.

Thanks once again,
bob


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top