Insert a Watermark in a PDF Receipt

   Journey Manager (JM) The transaction engine for the platform.  |    System Manager / DevOps  |  v4.3 & Higher   This feature is related to v4.3 and higher.

You can creating a watermark on every rendered receipt by running a Groovy service, which will render the standard PDF receipt using iText to overlay HTML.

  1. Publish your form to Manager, which will perform all the work, so no additional effort is needed in Composer.
  2. Go to Services > Service Definitions
  3. Import this Groovy Service.
  4. Add two form version properties called Include Footer and Include Header i.e. Form dashboard > Properties as shown below:
  5. Go to the Form Version > Services and include the Receipt Render Service.
  6. Update the following Groovy code to change the position of your watermark:
    def addHeader = addOverlayContent.curry(
     getTemplate("Header HTML Template"),
       [envName: tmEnv],
       245, 40, 600, 832
    );
    The coordinates above are: lower left X, lower right Y, upper right X, upper left Y
  7. Render and submit your form to test the generated receipt or use the receipt test harness. If it is not working, check the system error log.
  8. If you get this error, check that you have created the two form properties.

Next, learn how to configure receipts server node.