Java examples for 2D Graphics:Print
Setting the Orientation of a Print Job -- Portrait or Landscape
try { // Set up the attribute set PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); if (portrait) { aset.add(OrientationRequested.PORTRAIT); } else { aset.add(OrientationRequested.LANDSCAPE); } // Print it job.print(doc, aset); } catch (PrintException e) { }