471,316 Members | 1,278 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Java Print Landscape

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);
pageFormat.setOrientation(PageFormat.LANDSCAPE);
pageFormat.setPaper(paper);
g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
etc. print still portrait width!!!!!!
Jul 17 '05 #1
0 4326

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by gilga123 | last post: by
4 posts views Thread by viki | last post: by
reply views Thread by Matthew Belk | last post: by
1 post views Thread by nuhura01 | last post: by
2 posts views Thread by Brad Pears | last post: by
2 posts views Thread by Gianni | last post: by
reply views Thread by rosydwin | 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.