SetOrient

PrinterJob pjob = PrinterJob.getPrinterJob();
PageFormat pf = pjob.defaultPage();

if (portrait) {
    pf.setOrientation(PageFormat.PORTRAIT);
} else {
    pf.setOrientation(PageFormat.LANDSCAPE);
}

pjob.setPrintable(printable, pf);
try {
    pjob.print();
} catch (PrinterException e) {
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.