HOW-TO add a text watermark

Since DJ 5.0.4 it is possible to add basic text watermark like this

dj-waternark dj-waternark2

 

The simplest way to add it is with the DynamicReportBuilder or FastReportBuilder passing only the text (it uses default values)

FastReportBuilder drb = new FastReportBuilder();
drb.addColumn("State", "state", String.class.getName(),30)
   ...
   .addWatermark("TOP SECRET")
   ...

If you want to pass more parameters such as fontcolor, and angle use this version

drb.addColumn("State", "state", String.class.getName(),30)
   ...
   .addWatermark("SUPER CONFIDEN TIAL", courierNewBigBold, Color.CYAN, DJWaterMark.ANGLE_0)

Checkout this tests for usage example