首页新闻找找看学习计划

Java项目线程阻塞

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;
    }
沉焱的主页 沉焱 | 菜鸟二级 | 园豆:204
提问于:2019-02-22 18:31
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册