码迷,mamicode.com
首页 > 其他好文 > 详细

e682. 获得打印页的尺寸

时间:2018-09-02 23:52:26      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:page   style   ima   obj   for   getheight   color   examples   bsp   

Note that (0, 0) of the Graphics object is at the top-left of the actual page, which is outside the printable area.

    public int print(Graphics g, PageFormat pf, int pageIndex) {
        // The area of the printable area.
        double ix = pf.getImageableX();
        double iy = pf.getImageableY();
        double iw = pf.getImageableWidth();
        double ih = pf.getImageableHeight();
    
        // The area of the actual page.
        double x = 0;
        double y = 0;
        double w = pf.getWidth();
        double h = pf.getHeight();
        return Printable.NO_SUCH_PAGE;
    }

 

Related Examples

e682. 获得打印页的尺寸

标签:page   style   ima   obj   for   getheight   color   examples   bsp   

原文地址:https://www.cnblogs.com/borter/p/9575601.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!