I'm using iTextSharp to populate the data to PDF Templates, which is created in OpenOffice. it populating fine, I'm getting proper PDF, Watermark is not displaying properly.
below is my code:
public void addWaterMark(PdfStamper stamper, int pageNumber, Watermark watermark)
{
List<WatermarkField> watermarkFields = watermark.getWatermarkFieldAsReference();
for (WatermarkField watermarkField : watermarkFields) {
// setting font and font size for the watermark text
Font FONT = new Font(FontFamily.HELVETICA, watermarkField.getFontSize(), Font.BOLD, new GrayColor(0.75f));
// setting alignment for the watermark
ColumnText.showTextAligned(stamper.getUnderContent(pageNumber), Element.ALIGN_CENTER, new Phrase(watermarkField.getText(), FONT), watermarkField.getXDirection(), watermarkField.getYDirection(), watermarkField.getRotation());
}
}
When i putting in background text-boxes are hiding the watermark.
When i putting in foreground watermark is hiding the text.
Both screen shorts are attaching below.
Please Suggest me the solution. Thanks.