we are sending a string to a lpr using
FILE *prn = popen ( "lpr","w");
finally we do a pclose()
this routine get called for some asynchronous event.
the problem is that after every close or new open ( i dont know ) the lpr gives a page feed ( or form feed ) and runs to the next page.
now the stuff we are printing is 5 lines long i dont want the whole page to go waste.. how do i stop this from happening.
i tried keeping FILE *ptr as extern but it does not work ( should it work, ?? )
HELP !!!
rahul
Rahul Saxena wrote:
we are sending a string to a lpr using
FILE *prn = popen ( "lpr","w");
finally we do a pclose()
this routine get called for some asynchronous event.
the problem is that after every close or new open ( i dont know ) the lpr gives a page feed ( or form feed ) and runs to the next page.
Isn't this as simple as popen()'ing only once and repeatedly writing to it? Perhaps you need to fflush() every time.
-Manish
the problem is that after every close or new open ( i dont know ) the lpr gives a page feed ( or form feed ) and runs to the next page.
has the lpr daemon been set up for "send Linefeed after each job" or some similar settings??? well i am not sure where this option is....you may just try to run the program with lpr disabled or try to take a peak into lpr settings. HTH
Kiran Ghag Software Engineer @ Patni Computers, India Work Phone: +91 (22) 2829 1454 Extension 5236 Web Page: http://kiran7.freeservers.com _____
Cloning is the sincerest form of flattery.