ITPub博客

首页 > 应用开发 > > Java项目线程阻塞

Java项目线程阻塞

作者:petterchx 时间:2019-08-20 10:50:12 0 删除 编辑

private static final int topValue = 2;
    private static final int leftValue = 0;
    private static final int rightValue = 0;

    private static final int bottomValue = 0;
    private static final int userSpaceWidth = 1150;
    private static  PD4ML pd4ml = null;
    private Pd4Util(){}
    private static class Pd4mlUtilHolder{
        private final static Pd4Util instance = new Pd4Util();
    }

    public static Pd4Util getInstance(){
        return Pd4mlUtilHolder.instance;

    }

    public static PD4ML getPD4ml() throws Exception{
        if (pd4ml == null){
            synchronized (Pd4Util.class){
                pd4ml = new PD4ML();
                pd4ml.setHtmlWidth(userSpaceWidth); // set frame width of "virtual web browser"
                pd4ml.setPageSize(pd4ml.changePageOrientation(PD4Constants.A4));
                pd4ml.setPageInsetsMM(new Insets(topValue, leftValue, bottomValue, rightValue));
                pd4ml.addStyle("body {margin: 0; letter-spacing:1px;}", true);
                pd4ml.addStyle(" table{word-wrap:break-word; word-break:break-all;  border-collapse:collapse;  cellpadding='1'; cellspacing='1';}", true);//
                pd4ml.addStyle(" #table-css td, tr{ border:1.5px solid #000; padding:0.2em;  }", true);//dashed   background-color:#fff;
                try {
                    pd4ml.useTTF("java:fonts",true);
                } catch (FileNotFoundException e) {
                    e.printStackTrace();
                    throw new Exception("pd4ml插件初始化出错");
                }
                pd4ml.setDefaultTTFs("SIMHEI", "SIMHEI", "Arial");
                Dimension dimension = new Dimension(210, 297);
                pd4ml.setPageSizeMM(dimension);
                pd4ml.enableDebugInfo();
            }
        }
        return pd4ml;
    }


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4606/viewspace-3150680/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: vue路由跳转
请登录后发表评论 登录
全部评论

注册时间:2019-10-24

  • 博文量
    131
  • 访问量
    30132