Setting the Orientation of a Print Job -- Portrait or Landscape : Print Job « 2D Graphics GUI « Java






Setting the Orientation of a Print Job -- Portrait or Landscape

  

import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.OrientationRequested;

public class Main {
  public static void main(String[] argv) throws Exception {
    // Set up the attribute set
    PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
    aset.add(OrientationRequested.PORTRAIT);
    // aset.add(OrientationRequested.LANDSCAPE);

  }
}       

   
    
  








Related examples in the same category

1.Cancelling a Print Job
2.Determining Print Job Capabilities Supported by a Print Service
3.Getting the Default Value of a Print Job Capability
4.Getting the Possible Values for a Print Job Capability
5.Setting the Number of Copies of a Print Job
6.Listening for Print Job Status Changes
7.Listening for Print Job Attribute Changes
8.Determining When a Print Job Has Finished
9.How to print 2D graphicsHow to print 2D graphics