Skip to main content

[JAVA2D] Too small page in case of Java Printing API.

1 reply [Last post]
Anonymous

Hello,

I have problem with resolution of printer using Java 2D Printing API.
Despite my printer has 600 x 600 DPI, inside
java.awt.print.Printable.print(Graphics, PageFormat, int) I receive page
format with 600 x 840 page size.

I have tried to set resolution using
javax.print.attribute.PrintRequestAttributeSet and
javax.print.attribute.standard.PrinterResolution, but with no result.

Can anybody solve this problem?

Regards,
Karl.
--
View this message in context: http://www.nabble.com/Too-small-page-in-case-of-Java-Printing-API.-tp242...
Sent from the Sun - Java2D-Interest mailing list archive at Nabble.com.

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Phil Race

The size you are seeing is in always user space coordinates.
If you examine the transform (Graphics2D.getTransform()) you'll see
that there's a scale from user coordinates to device resolution.
You'll also notice that line from 0,0 to 600, 480 fully crosses
the printable area of the page, showing that this is working properly.

-phil.

On Jun 26, 2009, at 6:03 AM, karlklin wrote:

> Hello,
>
> I have problem with resolution of printer using Java 2D Printing API.
> Despite my printer has 600 x 600 DPI, inside
> java.awt.print.Printable.print(Graphics, PageFormat, int) I receive
> page
> format with 600 x 840 page size.
>
> I have tried to set resolution using
> javax.print.attribute.PrintRequestAttributeSet and
> javax.print.attribute.standard.PrinterResolution, but with no result.
>
> Can anybody solve this problem?
>
> Regards,
> Karl.
> --
> View this message in context: http://www.nabble.com/Too-small-page-in-case-of-Java-Printing-API.-tp242...
> Sent from the Sun - Java2D-Interest mailing list archive at
> Nabble.com.
>
> =
> =
> =
> =
> =
> ======================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in
> the body
> of the message "signoff JAVA2D-INTEREST". For general help, send
> email to
> listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".