Hi,
if I insert a watermark into a document and then save it as a pdf. The watermark is not displayed in the document. When saving the document as .doc all looks well.
This is how I insert the watermark:
// Create a watermark shape. This will be a WordArt shape.
Shape watermark = new Shape(document, ShapeType.TEXT_PLAIN_TEXT);
// Set up the text of the watermark.
watermark.getTextPath().setText(watermarkText);
watermark.getTextPath().setFontFamily("Arial");
watermark.setWidth(500);
watermark.setHeight(400);
// Text will be directed from the bottom-left to the top-right corner.
watermark.setRotation(-45);
// Remove the following two lines if you need a solid black text.
watermark.getFill().setColor(Color.LIGHT_GRAY);
watermark.setStrokeColor(Color.LIGHT_GRAY);
// Place the watermark in the page center.
watermark.setRelativeHorizontalPosition(RelativeHorizontalPosition.PAGE);
watermark.setRelativeVerticalPosition(RelativeVerticalPosition.PAGE);
watermark.setWrapType(WrapType.NONE);
watermark.setVerticalAlignment(VerticalAlignment.CENTER);
watermark.setHorizontalAlignment(HorizontalAlignment.CENTER);
// Create a new paragraph and append the watermark to this paragraph.
Paragraph watermarkPara = new Paragraph(document);
watermarkPara.appendChild(watermark);
Is there anything wrong with this code?