e683. 设置打印的方向
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) { }
Related Examples |