Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!ut-sally!pyramid!pesnta!lpi3230!steve From: steve@lpi3230.UUCP (Steve Burbeck) Newsgroups: net.micro.pc Subject: printing bitmaps to ThinkJet from within Microsoft C program Message-ID: <165@lpi3230.UUCP> Date: Sat, 5-Jul-86 16:46:10 EDT Article-I.D.: lpi3230.165 Posted: Sat Jul 5 16:46:10 1986 Date-Received: Sun, 6-Jul-86 04:42:58 EDT Expires: Thu, 31-Jul-86 04:00:00 EDT Organization: Linus-Pauling Institute, Palo Alto, Calif. Lines: 25 MICROSOFT C PROBLEM? The task is to output a binary bit map to a printer (in this case, an HP ThinkJet, but the same problem occurs with an IBM Proprinter). The seemingly reasonable way to do it is with the following kind of open and write (using Microsoft C version 3.00, an IBM PC/AT, and DOS 3.1): handle = open(name,mode|O_BINARY); i = write(handle, buf, i); The printer is opened by name 'PRN'. The problem is that the write terminates whenever it encounters a bit pattern byte with a value of hex 1A (decimal 26 which is the DOS EOF char). If the same bitmap data is written to a disk file, then copied to the PRN device using DOS COPY /B, the EOF data bytes cause no problem! Does anyone have a clue? By the way, the program must not be required to know that it is writing to a printer, the open must be general purpose. So a solution that works only for the printer, but fails for writing to a disk file is not useful. Steve Burbeck Linus Pauling Institute (415) 327-4064