Microsoft KB Archive/173197
PRB: ResetDC Disables Duplex Printing on PCL Printers
The information in this article applies to:
- Microsoft Win32 Application Programming Interface (API), used with:
- Microsoft Windows NT Server version 4.0
- Microsoft Windows NT Workstation version 4.0
- Microsoft Windows 95
When you call ResetDC to change any printer setting, it appears to disable Duplex (double-sided) printing when the target printer is a Hewlett Packard PCL printer.
PCL printers treat a change in paper size as a new print job that requires the printer to be initialized. This causes the printer to eject any page that is currently in the printer. The PCL printer drivers for Windows assume that the page size has been changed when ResetDC is called, unless the orientation of the page has changed.
To prevent having a page ejected when you call the ResetDC function, make sure that the function is called only between individual sheets of paper. Calling the ResetDC function before printing odd-numbered pages is sufficient for most applications that use duplex printing. However, some applications require that you change the page orientation on a page-by-page basis. In this case, you can call ResetDC between individual sheets of paper if the orientation has changed.
This behavior is by design.
Note that when this problem occurs the print job continues and the sheets of paper are passed through the printer's duplexer, but the sheets are only printed on one side.
Because of the page size initialization requirement for PCL printers, Windows PCL drivers treat the ResetDC function differently. These drivers allow only the orientation to change between the front and back pages of a sheet of paper. This means that ResetDC ejects the page unless the orientation (and only the orientation) has changed from the previous page. Calling ResetDC with a DEVMODE buffer that has not changed causes the printer to eject the page.
In general, you should only call ResetDC when printer settings change. Calling ResetDC for every page when the DEVMODE buffer has not changed is unnecessary. By doing so, you risk having a page ejected from the printer, which has a high probability of occurring.
Additional query words: fail bug
Keywords : kbOSWinNT400 kbOSWin95
Issue type : kbprb
Technology : kbAudDeveloper kbWin32sSearch kbWin32API
Last Reviewed: December 16, 2000