Its a little hokey, but you can look at the scale on the graphics passed
into your print method and multiply it by 72 to get the printer dpi.

eg if scale is 4.17 that's a 300 dpi printer.
note printers may have different x & y resolutions so the x & y scales
may be different.

note that an implementation detail is that for every page the sun implementation
calls print 1st with a 72 dpi (1.0,1.0) scale just to "peek".

subsequent callbacks  on that page index will show the true printer resolution.

1.4 has explicit APIs to query the supported device resolutions and even
to specify which one you want : look at the javax.print package.

BTW I am curious to know why you need to know this.

-phil.

> Date: Wed, 31 Oct 2001 11:26:33 -0500
> From: Karen Johnson <[EMAIL PROTECTED]>
> Subject: [JAVA2D] Determining printer resolution
> To: [EMAIL PROTECTED]
>
> In jdk1.3, is there any way to determine printer resolution?  Eg. get it
> somehow from the printer graphics context?
>
> Thank you,
>
> K. Johnson
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA2D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to