|
-
September 28th, 1999, 12:41 PM
#1
Printing in MFC
I'm passing a binary string of PCL commands to a LaserJet printer through our app. However, a reset sent to the printer at the beginning of the print job disables the overlay macro I'm trying to use. Does anyone know where I can look to figure out how to suppress sending a reset at the head of a print job or insert my PCL call just after it? I guess I need to get into the bowels of Windows printing but am at a loss where to begin.
Thanks.
-
September 28th, 1999, 01:19 PM
#2
Re: Printing in MFC
You may have to use the Win32 API Escape() function to write your own PCL character sequences to the printer. This is how I used to do it in Win 3.x a long time ago.
Regards,
Paul McKenzie
-
September 28th, 1999, 01:27 PM
#3
Re: Printing in MFC
Also, if you take a look at Article Q96795 in MSDN, it describes a Visual Basic program that uses Escape() to write to the printer. Even though it's VB, the Escape() call is a Win API call, and the code is easily changed to C++.
Regards,
Paul McKenzie
-
September 28th, 1999, 01:45 PM
#4
Re: Printing in MFC
Okay, I'll take a look at the article. However, would this allow me to bypass the reset being sent to the printer by Windows? I'm already sending a PCL sequence but it gets sent before the first page. Would the Escape() allow me to insert into the current page?
-
September 28th, 1999, 02:13 PM
#5
Re: Printing in MFC
I'm pretty sure you can control the PCL sequence without Windows sending out codes that you do not want. What function(s) are letting Windows take control of the printer? The only ones that I'm aware of are the GDI functions. There is also StartDoc() and EndDoc() which you may want to investigate. If you are calling StretchBlt() or some other GDI function for the printer, you really have no control of what is going on, since it is the printer driver's responsibility to generate the correct PCL to emulate the GDI call. StartDoc() and EndDoc() may also do something with the printer, but I'm not sure.
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|