Hi Team ,
how to add watermark only in one page .is it possible?
Thanks
//Load the sample document
Document doc = new Document();
doc.loadFromFile("Sample.docx");
//Add WordArt shape and set the size
ShapeObject shape = new ShapeObject(doc, ShapeType.Text_Plain_Text);
shape.setWidth(60);
shape.setHeight(20);
//Set the text, position and sytle for the wordart
shape.setVerticalPosition(30);
shape.setHorizontalPosition(20);
shape.setRotation(315);
shape.getWordArt().setText("Confidential");
shape.setFillColor(Color.red);
shape.setLineStyle(ShapeLineStyle.Single);
shape.setStrokeColor(new Color(192, 192, 192, 255));
shape.setStrokeWeight(1);
// Add a section
Section section = new Section(doc);
doc.getSections().insert(0,section);
HeaderFooter header;
//Get the header of section
header = section.getHeadersFooters().getHeader();
Paragraph paragraph1 = header.addParagraph();
// Insert shape into paragraph of header
shape = (ShapeObject) shape.deepClone();
shape.setVerticalPosition(200);
shape.setHorizontalPosition(180);
paragraph1.getChildObjects().add(shape);
//Save the document to file
doc.saveToFile("Result.docx", FileFormat.Docx_2013);