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
posted @ 2018-09-02 21:58  borter  阅读(327)  评论(0编辑  收藏  举报