Hi Knut,

> the print() method gets called usually twice, once with the identical
> transformation and then with a transformation that scales the 72dpi into
> the real printer resolution.  Before finding that, we just defined our one
> transformation which replaced the preset one, thus the output was always
> to small.

The transformation you get in the print() method is set up so that one
user coordinate equals a printer's point (~72DPI).  You should not be
second guessing this transformation because you don't believe that it
is correct.  In particular, the reason that the first call is at 72DPI
is that it is just a pre-scan to see what you will be drawing and where
you are drawing it, the transformation is irrelevant on that pass.

The second pass actually generates output and if you are only generating
text and solid color fills and strokes then you will only get that second
pass and no more.  If you do anything else - images, non-opaque colors,
custom composites, etc - then the current implementation uses bitmap
printing which calls you over and over to rerender the page each with
a slightly different horizontal "band" being recorded in a BufferedImage
and then sent on to the printer.

Hopefully that explains the behaviors you are seeing.

As far as the boxes are concerned it sounds like you are running into
a bug in our text scaling code.  If you don't activate the bitmap
printing mode then we send text outlines to the printer which avoids
the bug so you only see it if you also render images (or any of the
other custom cases I outlined above).  Can you send a reproducible
test case to [EMAIL PROTECTED]?

                                ...jim

=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 2D Home Page: http://java.sun.com/products/java-media/2D/

Reply via email to