I am looking for multi-line textual watermark feature. Does iText latest version support this feature? I am attaching a picture of the requirement. Let me know your findings.
Here is an example of how to add repeating watermark as the background to an existing document:
pdfDocument = new PdfDocument(new PdfReader(inFileName), new PdfWriter(outFileName)); PdfPattern.Tiling tiling = new Tiling(new Rectangle(100, 50)); new Canvas(new PdfPatternCanvas(tiling, pdfDocument), pdfDocument, tiling.getBBox()).add(new Paragraph("TESTING") .setFontColor(ColorConstants.RED) .setRotationAngle(Math.PI / 10)); for (int i = 1; i <= pdfDocument.getNumberOfPages(); i++) { PdfPage page = pdfDocument.getPage(i); new PdfCanvas(page.newContentStreamBefore(), page.getResources(), pdfDocument) .saveState() .setFillColor(new PatternColor(tiling)) .rectangle(page.getCropBox()) .fill() .restoreState(); } pdfDocument.close();
This is how the result look visually:
Here is an example of how to add repeating watermark as the background to an existing document:
This is how the result look visually: