[comp.periphs] Dot-matrix Graphics on Various Printers

scs@adam.pika.mit.edu (Steve Summit) (08/02/89)

I have written a few programs to do dot-matrix graphics on an
NEC P6 Pinwriter, and I now have occasion to get these programs
working on two other printers, neither of which I have
documentation for.

I believe that the P6 implements a superset of some de-facto
standard "Epson" escape codes.  The problem is that I don't
really know which codes I'm using are "standard" and likely to
work on most PC printers, and which are NEC extensions.

The two printers I'm interested in expanding to first are a dinky
little Diconix (ink jet, apparently, manufactured by Kodak) and
an IBM QuietWriter.  It appears that the Diconix accepts many of
the codes I've been using (albeit at a different resolution); I
know nothing about the QuietWriter.

The escape sequences I've been using are

	ESC 3 n		set line spacing in 180ths
	FS 3 n		set line spacing in 360ths
	ESC \ n1 n2	horizontal motion
	ESC K n1 n2	bitmap graphics, 60 dpi
	ESC * m n1 n2	bitmap graphics, programmable resolution
	ESC x n		set letter-quality/draft mode
	ESC P		set 10 cpi pitch
	ESC 2		set 6 lpi
	ESC 0		set 8 lpi

So far, as long as I stay away from ESC \ and FS 3 (which don't
work), I can get my plots to come out on the Diconix, except that
the resolution isn't 60dpi (the plots are smaller than I expect).
Is there a better way to move horizontally (other than explicit
spaces)?  What's the story on resolution?

Can a QuietWriter do graphics?  Does it accept escape sequences
anything like the ones above?  Is there an extra escape sequence
to put it in graphics (Epson emulation?) mode?  (The one screen
dump program I tried didn't work.)

Ideally, I'd like to target whatever de-facto standards there are
for PC dot-matrix graphics, rather than tailoring my software for
each new printer I have occasion to use.  If anyone has any
suggestions on how best to achieve this, I'd be interested to
hear them.  (The various screen dump programs seem to do pretty
well at driving arbitrary printers, so there must be some
standards or subsets which are widely accepted.)

One other question, in case I've reached any PC printer graphics
gurus: is there a decent solution to what I call the bitmap 26
problem?  You can't send an ASCII 26 (0x1A) to device PRN,
because it's a control-Z, and DOS, in its infinite wisdom, looks
for it going by and, in the process of thinking it's an end-of-
file, deletes it and (apparently) the following character.  This
wreaks havoc with the bitmap being output.  Right now, I'm
examining every byte in every bitmap I send out and if it's a 26,
toggling a random bit (!) just to keep things from getting
garbaged up.  (I could explicitly use the BIOS printer interrupt,
which sends control-Z's through unmolested, but I prefer to
create my graphics in regular files which can be spooled with the
PRINT command, etc.)

Please reply by mail, if possible, since I don't really follow
these newsgroups.  ("If possible" refers to the fact that mail
into adam is, alas, unreliable.)

                                            Steve Summit
                                            scs@adam.pika.mit.edu

andrea@hp-sdd.hp.com (Andrea K. Frankel) (08/03/89)

In article <13208@bloom-beacon.MIT.EDU> scs@adam.pika.mit.edu (Steve Summit) writes:
>One other question, in case I've reached any PC printer graphics
>gurus: is there a decent solution to what I call the bitmap 26
>problem?  You can't send an ASCII 26 (0x1A) to device PRN,
>because it's a control-Z, and DOS, in its infinite wisdom, looks
>for it going by and, in the process of thinking it's an end-of-
>file, deletes it and (apparently) the following character.  

Simple solution:  don't use print, use "copy /b foo > lpt1:" and DOS
will know to keep its mitts off of your bits.


Andrea Frankel, Hewlett-Packard (San Diego Division) (619) 592-4664
	"wake now!  Discover that you are the song that the morning brings..."
______________________________________________________________________________
UUCP     : {hplabs|nosc|hpfcla|ucsd}!hp-sdd!andrea 
Internet : andrea%hp-sdd@hp-sde.sde.hp.com (or @nosc.mil, @ucsd.edu)
CSNET    : andrea%hp-sdd@hplabs.csnet
USnail   : 16399 W. Bernardo Drive, San Diego CA 92127-1899 USA

ralerche@lindy.Stanford.EDU (Robert A. Lerche) (08/03/89)

If you want to write undisturbed binary to the PRN device from a program
(as opposed to copying a file with "/b"), you have to issue the set device
data IOCTL call specifying "raw" mode. (DOS function 4401H, with bit 20H
on in DL).  Then DOS will allow ctrl-Z's to pass through.