Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

setting the orientation of the printer through PrintJob

843807Jun 29 2001 — edited Jun 29 2001
i need help in setting the orientation of the printer
i am using the class printJob



Full code is here
public class printing
{
private static Properties printprefs = new Properties();
public void print_method
{
Graphics Arrpage;

Arrpage=new Graphics();
Toolkit toolkit = this.getToolkit();
printprefs.setProperty("java.awt.print.PageFormat", "PageFormat.LANDSCAPE");
// printprefs.put("java.awt.print.PageFormat", "PageFormat.LANDSCAPE");

PrintJob job = toolkit.getPrintJob(new Frame(), user, printprefs);

Arrpage= job.getGraphics();
................
Arrpage.dispose();
job.end();

its does not print in landscape.



}
}




Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 27 2001
Added on Jun 29 2001
1 comment
152 views