public PageFormat getPageFormat() {
PrinterJob job = PrinterJob.getPrinterJob();
if (myPageFormat == null) {
myPageFormat = job.defaultPage();
// restore
myPageFormat.setOrientation(round(get(PAGE_ORIENTATION, PageFormat.PORTRAIT)));
Paper paper = myPageFormat.getPaper();
if (get(PAPER_WIDTH, null) != null && get(PAPER_HEIGHT, null) != null) {
paper.setSize(get(PAPER_WIDTH, INCH), get(PAPER_HEIGHT, INCH));
}
if (get(AREA_X, null) != null && get(AREA_Y, null) != null && get(AREA_WIDTH, null) != null && get(AREA_HEIGHT, null) != null) {
paper.setImageableArea(get(AREA_X, INCH), get(AREA_Y, INCH), get(AREA_WIDTH, INCH), get(AREA_HEIGHT, INCH));
}
myPageFormat.setPaper(paper);
}
return myPageFormat;
}
Config.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:incubator-netbeans
作者:
评论列表
文章目录