如何使用poi在excel中设置背景水印图像

时间:2012-09-22 10:21:06

标签: java apache-poi

我使用以下代码在Excel工作表中设置水印,我也得到水印但不显示后面的水印,而是显示前景水印。

如何解决这个问题,代码:

//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?

请帮我找到并解决问题。

0 个答案:

没有答案