Using dynamic data in dynamic PDF watermarks

When using PDF Watermark, one of the nice features is to display some dynamic data as part of that watermark. This might be something like the current time the document was viewed/saved/printed, the user who was accessing the document, or perhaps the Content ID identifier so that you could later go back and easily reference that same document.


Unfortunately, the variables you use to display that dynamic data is not very clear in the documentation. Someone just pinged me about them so I thought I would share them here.

Here is a list of the environment or metadata variables you can include.
Environment variables:

  • $PAGE$

  • $DATE$

  • $TIME$

  • $USER

Metadata variables:

  • $$dDocName$$

  • $$dDocType$$

  • $$dDocAuthor$$

  • $$dSecurityGroup$$

  • $$xComments$$

So for metadata, you basically just surround your field identifier with double dollar signs before and after it. So in the above screenshot, the Text for the watermark is:

Viewed: $TIME$ on $DATE$ - User: $USER$ - Content ID: $$dDocName$$


I like using watermarks to flag content as invalid... lots of people print out process and procedure documents, and it's helpful to have a 'xReviewDate' so the content stays fresh... then you put a watermark like "invalid after $$xReviewDate$$" on it, in case somebody prints it out and leaves it lying about.

Posted by bex on September 16, 2010 at 07:52 AM CDT #

This is an excellent article. Thank you for listing out all the environment variables. This is really helpful. Can you please suggest me a way to display partial value of a metadata value (especiall for date fields) as water mark. I would like to display only the date part (ignore time part) of date type metadata. I really appreciate your help. Thanks, Bhanu.

Posted by Bhanu on April 06, 2011 at 04:18 AM CDT #

Hello Bhanu, Unfortunately, you cannot add scripting into the variables used in watermarks. So it's always going to display the entire value. But one workaround is to create a second hidden metadata field defined as just a Text field. Then you can set a global rule on that field and set it's Derived Value to be that of your date field..with only the date. So this is what the derived field code would look like: <$dprDerivedValue=formatDateOnly(xDateField)$> This will then take the value entered in your real field (xDateField) and make the value in this new field to be just the date. Then you can define this new field as what to display on the PDF watermark. Thanks, Kyle

Posted by kyle.hatlestad on April 11, 2011 at 11:48 PM CDT #

Kyle - this is great information and solves a problem we've been asked to solve -- allowing printing of a process from pdf yet complying with ISO requirements. THANKS!

Posted by Donna on April 12, 2011 at 12:10 AM CDT #

Thank you Kyle for quick response. I really appreciate it. I have implemented the approach you have suggested and it is working pefectly now. Bhanu.

Posted by Bhanu on April 19, 2011 at 06:07 AM CDT #

Congratulations for the excellent article Kyle!

Posted by florin marcus on July 13, 2011 at 05:51 PM CDT #

Hi Kyle,
I followed it to show dynamic information. I was successfully able to show dynamic information as a text but I want dynamic image as watermark. My approach was to store content_id of image as a metadata (say UserSignImageContentID) of actual content and then create a image watermark template with contentID as $$xUserSignImageContentID$$.
System is able to show value of $$xUserSignImageContentID$$ as text watermark but failed to replace it dynamically with image watermark contentID.

I get exception

Looks like system wants a fix contentID with image watermarking.

Can you suggest something here?


Posted by Sanjeev on May 16, 2012 at 04:54 AM CDT #

Hello Sanjeev,

Yes, I'm afraid there does not appear to be a way to dynamically apply the Content ID for the image watermark.


Posted by Kyle Hatlestad on June 12, 2012 at 08:28 AM CDT #

Hi Kyle,

Currently I am working on this component for one of our client. I have done the set up and it works just fine except in one use case and i.e., when the client is trying to get the watermark on image based pdf. The settings working fine for text-based pdfs but not for image based. Do you have any idea about any setting or configuration to be done in order to get watermark on image-based pdf?

Thanks in Advance
Sam Sitr

Posted by Sam on February 05, 2013 at 09:24 AM CST #

Hello Sam,

An image-based PDF should not be a problem for watermarks. You just need to make sure the Layer is set to 'Over'. Here is an example of an image based PDF (TIFF converted to PDF with PDFExport) with a watermark -

If you still can't get it to work, I'd suggest contacting technical support to have them look at it.


Posted by guest on February 05, 2013 at 09:47 AM CST #

Hi Kyle,

Thanks for a great post!

I am trying to use the following dynamic data:
Viewed: $TIME$ on $DATE$ - User: $USER$ - Content ID: $$dDocName$$ - Revision: $$dRevLabel$$ - Last updated: $$dReleaseDate$$

Unfortunatly the metadata variable $ReleaseDate$ displays the output in the format "{ts '2013-04-17 13:22:06.244'}". Do you know how I can format the output so it displays in the following format and without the initial "ts": "2013-04-17 13:22:06"?


Posted by guest on April 17, 2013 at 08:22 AM CDT #

Hello Ibrahim,

It looks like this was a bug identified and resolved for future versions (post 11g). If you would like it back-ported to your version, contact support and reference bug# 13472674.


Posted by Kyle Hatlestad on April 17, 2013 at 11:35 AM CDT #

Hi Kyle,

I've a requirement to place both dynamic and a static (e.g. confidential)watermark across a image PDF. The dynamic worked well at the top of the page but the static across the page ended up covering the PDF content.

Any recommendation to get around this?


Posted by guest on May 21, 2013 at 02:30 AM CDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Kyle Hatlestad is a Solution Architect in the WebCenter Architecture group (A-Team) who works with WebCenter Content and other products in the WebCenter & Fusion Middleware portfolios. The WebCenter A-Team blog can be found at: ateam_webcenter/


« July 2016