469,267 Members | 979 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,267 developers. It's quick & easy.

Java Print Landscape Width

Trying & trying ad infinitum to print page in landscape mode from Java
program - orientation is correct landscape but printing width will NOT
go to landscape - always prints in portrait mode width - how to get
width out to landscape??????

Graphics2D g2d = (Graphics2D)g;
//Paper paper = new Paper();
Paper paper = pageFormat.getPaper();

//default portrait width=468 hi=648 x=72 y=72
pwidth = paper.getImageableWidth();
phi = paper.getImageableHeight();

// reverse width & height for landscape
paper.setSize(phi, pwidth);
paper.setImageableArea(10, 10, phi, pwidth);
g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
etc. print still portrait width!!!!!!
Jul 17 '05 #1
0 1741

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by gilga123 | last post: by
2 posts views Thread by Yaron Cohen | last post: by
10 posts views Thread by David C | last post: by
reply views Thread by Matthew Belk | last post: by
5 posts views Thread by Brad Pears | last post: by
2 posts views Thread by Brad Pears | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.