how to set watermark image at background in excel using poi

房东的猫 提交于 2019-12-07 20:43:18

问题


i am using the following code to set water mark in the excel sheet, i also get the water mark but instead of showing the watermark at the back round it shows the water mark at foreground.

how to resolve this, the code :

//to add water mark
                HSSFPatriarch dp = sheet.createDrawingPatriarch();
                HSSFClientAnchor anchor = new HSSFClientAnchor
                    (0, 0, 1023, 255, (short) 2, 4, (short) 13, 26);
                HSSFTextbox txtbox = dp.createTextbox(anchor);
                HSSFRichTextString rtxt = new HSSFRichTextString("POC");
                HSSFFont draftFont = hwb.createFont();
                draftFont.setColor((short) 27);
                draftFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);
                draftFont.setFontHeightInPoints((short) 192);
                draftFont.setFontName("Verdana");
                rtxt.applyFont(draftFont);
                txtbox.setString(rtxt);
                txtbox.setLineStyle(HSSFShape.LINESTYLE_NONE);
                txtbox.setNoFill(true);

also how to merge the cells to add title at the top of the excel sheet using poi in java?

Please help me to find and resolve the isssue.

来源:https://stackoverflow.com/questions/12542923/how-to-set-watermark-image-at-background-in-excel-using-poi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!