PRB: Graphics File Printing Terminates PrematurelyLast reviewed: July 17, 1997Article ID: Q23867 |
6.00 6.00a 6.00ax 7.00 | 1.00 1.50
MS-DOS | WINDOWSkbprg kbprb
The information in this article applies to:
SYMPTOMSWhen an application sends graphics files to a printer, printing sometimes ends prematurely. Opening the printer as a binary file does not change the behavior.
CAUSEThe graphics file contains the CTRL+Z character (1Ah) and the printer was opened in "cooked" mode.
RESOLUTIONUse Interrupt 21h Function 44h to set the raw-mode bit for the printer device. In this mode, MS-DOS does not interpret CTRL+Z as the end-of-file character.
MORE INFORMATIONIf an application uses the fopen() or open() function to open a device, such as PRN, as a binary file, MS-DOS does not translate carriage return/line feed combinations. However, MS-DOS continues to interpret CTRL+Z as the end-of-file character. In the "raw" mode, MS-DOS does not interpret CTRL+Z in this manner. The following code example demonstrates setting raw mode from an application in C.
Sample Code
void setrawmode(void){ union REGS inregs, outregs; inregs.x.ax = 0x4400; inregs.x.bx = 0x04; // Specify the printer int86(0x21, &inregs, &outregs); outregs.h.dh = 0x00; outregs.h.dl = 0x20; // Set raw mode bit outregs.x.ax = 0x4401; int86(0x21, &outregs, &inregs);}
|
Additional reference words: 1.00 1.50 6.00 6.00a 6.00ax 7.00 end print
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |