Article View: comp.os.ms-windows.programmer.misc
Article #2133Re: Printing using the new Windows 3.1 API
From: Robert Krajewski
Date: Wed, 18 Nov 1992 16:17
Date: Wed, 18 Nov 1992 16:17
49 lines
2417 bytes
2417 bytes
In article <1992Nov18.012002.983@actrix.gen.nz> Peter.Hug@bbs.actrix.gen.nz writes:
From: Peter.Hug@bbs.actrix.gen.nz
Organization: Actrix Information Exchange
Date: Wed, 18 Nov 1992 01:20:02 GMT
Sender: Peter.Hug@actrix.gen.nz (Peter Hug)
I have two problems with printing under Windows 3.1:
1. Are there situations when an application must use "banding" for printing
or is this something an application can descide if it wants to make use of
this feature. If it is required with some printer drivers, how can this be
determined?
If you don't code for banding, Windows will do the banding itself.
This works, but might be a little slow or memory-hungry when imaging
large pages to "dumb" printers.
2. When using "banding", the sequence of printer functions I invoke is:
StartDoc(...);
while( more pages )
{
StartPage(...);
Escape(..., NEXTBAND, paintRectangle, ....);
while(!IsEmptyRect(paintRectangle))
{
paintBand(..., paintRectangle );
Escape(..., NEXTBAND, paintRectangle, ....);
}
EndPage(...);
}
EndDoc(...);
Unfortunately, EndPage() always returns SB_ERROR! Is there a cure? If I
dont use banding, everything works just fine!
I beleive that the EndPage is not needed. The 3.1 documentation for
NEXTBAND says you shouldn't use NEXTFRAME (now EndPage) after it.
Otherwise, your code looks fine. If the printer doesn't support
banding, then you'll just get one band, the entire page.
If you don't band yourself, Windows has to create a temporary page
image, and then send the whole thing down at once. This might cause
problems if you are low on memory. In fact, while the type of printer
affects whether you get more than one band, it's also possible to see
more bands in the loop you wrote above just by decreasing the amount
of available memory !
Technical Details
Message-ID:
<ROBERTK.92Nov18161718@rkrajewski.lotus.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!lotus!lotus.com!robertkReferences:
<1992Nov18.012002.983@actrix.gen.nz>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc Path: arc1-ca.pugleaf.net!sparky!uunet!lotus!lotus.com!robertk From: robertk@rkrajewski.lotus.com (Robert Krajewski) Subject: Re: Printing using the new Windows 3.1 API In-Reply-To: Peter.Hug@bbs.actrix.gen.nz's message of Wed, 18 Nov 1992 01:20:02 GMT Message-ID: <ROBERTK.92Nov18161718@rkrajewski.lotus.com> Sender: news@lotus.com Organization: Lotus Development Corporation References: <1992Nov18.012002.983@actrix.gen.nz> Date: 18 Nov 92 16:17:18 Lines: 49