[comp.text] Laserjet Questions

jantypas@ucrmath.UUCP (John Antypas) (09/10/88)

This may belong in laser-printers, but our news software doesn't new what
.EDU means so I figure this is the next best thing.

I have the task of writing a graphics package that will use the HP series of 
laser printers.  I'd like to be able to do a graphics image on the printer
at full (300 DPI) resolution.  According to my math, this means I have to
create a raster with 1M of space in it.  The question is this, how can create
a one megabyte raster in my machine, fill it and then send it to the laserjet?
The AT only has 1M of ram!  Is there a way to build the image in Laserjet
memory as I go rather than the AT?  In other words:

Do I?

	A) Build a 300 DPI (1M Ram) image in AT memory 
	   Transfer it to the laserjet

or 	B) Build the image into the laserjet memory?  How do I do this?
 
John Antypas -- Soft21 --21st Century Software:
UUCP: {crash, garp, killer, pyramid, reed, ucsd!ucrmath}!soft21!jantypas
Internet: jantypas%soft21.uucp@{garp.MIT.EDU, ucsd.EDU}
Domains:  jantypas@{soft21.Riverside.CA.US, soft21.CTS.COM}

rick@pcrat.UUCP (Rick Richardson) (09/10/88)

In article <405@ucrmath.UUCP> jantypas@Soft21.Riverside.CA.US (John Antypas) writes:
>
>	A) Build a 300 DPI (1M Ram) image in AT memory 
>	   Transfer it to the laserjet
>
>or 	B) Build the image into the laserjet memory?  How do I do this?

You may have to do either.  If you can guarantee that you will generate
the scan lines in order, then you can dump each scanline to the HP
as you build it.  You'll only need 300*WIDTH(inches)/8 bytes for this.
Even better, create and dump a handful of scanlines together.

If you are generating pieces of the image in no particular order,
then, IN GENERAL, you must rasterize the whole image and send it in
scanline order.  This is because the HP can get upset and give you
ERROR 21 if there are too many little bits of the image.  The drum
starts turning, but there isn't enough CPU horsepower to process
the next "strip" in time.  It seems dumb, but it happens.
Example: try dropping a single dot with each transfer raster graphics
command, at every other dot position on the whole page.  You just
can't do it this way on the LJ II.

Of course, this may not happen to you for your application.
If HP were more specific on the CPU load each glyph, raster segment,
or fill pattern requires, then you could, in theory, use a dual
approach of mostly ad hoc conversion with the occasional fully
rasterized section when you know the LJ II will be overburdened.
Alas, they aren't (more specific), and you can only guess.  This
would be the ultimate implementation of my Automatic Adaptive
Rasterization scheme.

If you don't have enough memory on the AT and you have to rasterize
the whole image, then you'll just have to put some of it on disk.

If you just can't get your compiler to grok "raster[300*11][300*8/8]",
try a pointer to each scanline, and malloc space for the scanline
if and when it is needed.
-- 
		Rick Richardson, PC Research, Inc.
		rick%pcrat.uucp@uunet.uu.net (INTERNET)
		   uunet!pcrat!rick (UUCP, Personal Mail)
..!pcrat!jetroff (JetRoff Info)		..!pcrat!dry2 (Dhrystone Submissions)

bturner@hpcvlx.HP.COM (Bill Turner) (09/13/88)

> Do I?
> 
> 	A) Build a 300 DPI (1M Ram) image in AT memory 
> 	   Transfer it to the laserjet
> 
> or 	B) Build the image into the laserjet memory?  How do I do this?

Even better, depending on how "full" the line is, you don't have to send the
full line.

If there is white space bounding the line, you can send curson positioning
data, then send just the bits you need.  If there are lots of gaps (white)
in the middle of the line, it might even save data transfer to break the
line into parts and send the parts.

That means your raster builder would have to be a bit more sophisticated 
than just building the full-page (or stipwise full-page) image, but it 
can cut down substantially on data to transfer.

--Bill Turner

bcripe@hpcvlx.HP.COM (Brian E. Cripe) (09/14/88)

> If there is white space bounding the line, you can send curson positioning
> data, then send just the bits you need.  If there are lots of gaps (white)
> in the middle of the line, it might even save data transfer to break the
> line into parts and send the parts.

Something you should be aware of with tricks like this is that it could 
make adding support for other printers (even HP PCL printers) much more
difficult.  For example, if you sent data formatted as described above to
a DeskJet, it would probably take several hours to print a page.

	Brian Cripe
	Hewlett-Packard
	bcripe@hp-pcd

rokicki@polya.Stanford.EDU (Tomas G. Rokicki) (09/14/88)

>Something you should be aware of with tricks like this is that it could 
>make adding support for other printers (even HP PCL printers) much more
>difficult.  For example, if you sent data formatted as described above to
>a DeskJet, it would probably take several hours to print a page.

On the other hand, using tricks like this can speed up output by more
than a factor of two.  On the DeskJet, adjusting your margins often can
speed things up quite a bit, but you will have to empirically determine
how often.  It's not obvious; it certainly isn't every 50 pins, although
that might not be a bad approximation.

But all implementations are not equal.  Take the NEC P6 and the Epson LQ.
The NEC P6 emulates the Epson LQ.  But if you try horizontal white-space
positioning on the Epson LQ, it goes crazy and takes forever to print;
the NEC just glides on, very fast and very smooth.  (The new LQ's now
handle it better, too.)  The solution?  Test your software as carefully
as possible.  It's always nice to supply a `stupid' driver along with
the optimized one; the stupid one should always work, but more slowly
than the other.  Especially when trying tricks with the Epson FX series.

>	Brian Cripe

So when can I put more useable graphics RAM in my DeskJet?  I only want
16K more . . . and of course cartridge RAM doesn't work for graphics.

-tom

george@mnetor.UUCP (George Hart) (09/15/88)

In article <101870003@hpcvlx.HP.COM> bcripe@hpcvlx.HP.COM (Brian E. Cripe) writes:
## If there is white space bounding the line, you can send curson positioning
## data, then send just the bits you need.
#
#Something you should be aware of with tricks like this is that it could 
#make adding support for other printers (even HP PCL printers) much more
#difficult.  For example, if you sent data formatted as described above to
#a DeskJet, it would probably take several hours to print a page.

Why would limiting the scanline to eliminate white space cause such
a degradation?  How expensive can positioning the head to skip white
space be?

Is it related to interference with bidirectional printing?
-- 
Regards.....George Hart, Computer X Canada Ltd.

UUCP: {utzoo,uunet}!mnetor!george
BELL: (416)475-8980