Introduction
try { // Set up the attribute set PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); if (portrait) { aset.add(ationRequested.PORTRAIT); } else { aset.add(ationRequested.LANDSCAPE); } // Print it job.print(doc, aset); } catch (PrintException e) { }