472,097 Members | 1,102 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,097 software developers and data experts.

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 1864

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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.