[comp.windows.ms.programmer] Windows printing

chroth@emx.utexas.edu (Charles H. Roth) (05/21/91)

We are in the process of converting a Macintosh program to run under Windows
3.0.  We are having a large number of problems printing graphics with
Windows.  We have tried the following: (1) Drawing directly to the printer port.
In this case part of the graphics printed correctly and part did not print at
all.  (2) Same as (1) except we did the banding ourselves.  In this case we
could get the graphics to print correctly by itself, but if we printed some
text and then the graphics on the same page, part of the graphics printed
correctly and part of the graphics did not print.  (3) Then we tried drawing
to a bit map and then copying the bit map the printer.  Save result as (2).
Furthermore, the printing is only partially printer independent.  For example,
some lines print too heavy on some printers but print correctly on others.
We have wasted several months trying to solve these printing problems and
desparately need some help.  Does anybody have any suggestions?  Also, the
graphics works correctly on a VGA, EGA and monochrome monitor, but it is not
quite right on a high-resolution VGA monitor.

ebergman@isis.cs.du.edu (Eric Bergman-Terrell) (05/21/91)

I recently worked quite a bit printing text and graphics in Windows 3.0.

I assume that you've read all about the BANDINFO escape (Prog. Ref., 12-3).

So, on a FWIW basis:

If you use banding, pay attention to the structure returned from the 
BANDINFO escape.  The BANDINFO will sometimes tell you that one band, equal
in size to the entire printing surface, should only be used for text output.

If you're bitblting a bitmap to the printer, make sure that it does not
need to be scaled.  If you're bitblting a color bitmap to the printer,
make sure that the color bitmap is bound to a real device, otherwise the
colors will not all be printed correctly.

It sounds like your main problem is that pages are not completely printed.
Does your printer have enough memory to hold all the graphics that you're
sending it?  Even if you write your printing program perfectly, if you send
it to a printer without sufficient memory, it may print only part of the
page (this is exactly what the HP LaserJet series printers do)...

Another suggestion - most if not all of the GDI & banding functions return
error codes.  Save them and find out which function is the first to fail...

Another suggestion - call get GetDeviceCaps function with the RASTERCAPS
argument to make sure that your printer can support all the graphics that
you're sending it...

Terrell