Hi,
I am writting an application in
java which needs to print graphics in different printer resolutions (300,600dpi...).
When I add image that needs to be printed, it's all good by default, image is printed in correct size, for example 1x1 inch (image size is set to 72x72 in user space (drawImage(...)).
AffineTransform is:
[8.333333333333334, 0.0, -75.0], [0.0, 8.333333333333334, -42.0]
that is 600dpi ?
When I change resolution to 300 dpi (new PrinterResolution(300,300...)) image is twice smaller !! ?
AffineTransform is:
[4.16, 0.0, -75.0], [0.0, 4.16, -42.0]
and so on...
on 72 dpi image is 8.33 times smaller.
How can I have the same size of printed images, on different printer resolutions ? Shouldn't the size be always the same in the device space (by conversion from user space to device space )?
Also how can I detect dpi resolutions that are available for a printer (max resolution at least)? I tried this:
AttributeSet attrs = new HashAttributeSet();
attrs.add(new PrinterResolution(300,300,PrinterResolution.DPI));
PrintService[] services = PrintServiceLookup.lookupPrintServices(null, attrs);
for (int j=0;j<services.length;j++)
System.out.println("selected printer: " + services[j]);
but I didn't get my printer which supports 300dpi...>